From commits-return-2959-apmail-jackrabbit-commits-archive=jackrabbit.apache.org@jackrabbit.apache.org Mon Oct 16 09:17:31 2006 Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 57157 invoked from network); 16 Oct 2006 09:17:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Oct 2006 09:17:31 -0000 Received: (qmail 8581 invoked by uid 500); 16 Oct 2006 09:17:29 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 8560 invoked by uid 500); 16 Oct 2006 09:17:29 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 8551 invoked by uid 99); 16 Oct 2006 09:17:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2006 02:17:29 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2006 02:17:28 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 1368C1A981A; Mon, 16 Oct 2006 02:17:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r464424 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java Date: Mon, 16 Oct 2006 09:17:07 -0000 To: commits@jackrabbit.apache.org From: angela@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061016091708.1368C1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: angela Date: Mon Oct 16 02:17:06 2006 New Revision: 464424 URL: http://svn.apache.org/viewvc?view=rev&rev=464424 Log: work in progress - purge values array Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java?view=diff&rev=464424&r1=464423&r2=464424 ============================================================================== --- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java (original) +++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java Mon Oct 16 02:17:06 2006 @@ -28,6 +28,8 @@ import javax.jcr.version.VersionException; import javax.jcr.lock.LockException; import javax.jcr.nodetype.ConstraintViolationException; +import java.util.List; +import java.util.ArrayList; /** * SetPropertyValue... @@ -42,7 +44,7 @@ this.propertyState = propertyState; this.propertyType = propertyType; this.values = values; - + addAffectedItemState(propertyState); } @@ -69,9 +71,17 @@ } //------------------------------------------------------------< Factory >--- - public static Operation create(PropertyState propState, QValue[] iva, + public static Operation create(PropertyState propState, QValue[] qValues, int valueType) { - SetPropertyValue sv = new SetPropertyValue(propState, valueType, iva); + // compact array (purge null entries) + List list = new ArrayList(); + for (int i = 0; i < qValues.length; i++) { + if (qValues[i] != null) { + list.add(qValues[i]); + } + } + QValue[] cleanValues = (QValue[]) list.toArray(new QValue[list.size()]); + SetPropertyValue sv = new SetPropertyValue(propState, valueType, cleanValues); return sv; } }