Return-Path: Delivered-To: apmail-incubator-jackrabbit-commits-archive@www.apache.org Received: (qmail 37835 invoked from network); 21 Apr 2005 14:26:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Apr 2005 14:26:16 -0000 Received: (qmail 8073 invoked by uid 500); 21 Apr 2005 14:26:29 -0000 Mailing-List: contact jackrabbit-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-commits@incubator.apache.org Received: (qmail 8030 invoked by uid 500); 21 Apr 2005 14:26:29 -0000 Delivered-To: apmail-incubator-jackrabbit-cvs@incubator.apache.org Received: (qmail 8023 invoked by uid 99); 21 Apr 2005 14:26:29 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 21 Apr 2005 07:26:28 -0700 Received: (qmail 37821 invoked by uid 65534); 21 Apr 2005 14:26:13 -0000 Message-ID: <20050421142613.37820.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r164066 - in /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: NodeImpl.java util/ValueHelper.java Date: Thu, 21 Apr 2005 14:26:12 -0000 To: jackrabbit-cvs@incubator.apache.org From: stefan@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: stefan Date: Thu Apr 21 07:26:11 2005 New Revision: 164066 URL: http://svn.apache.org/viewcvs?rev=3D164066&view=3Drev Log: fixed bug in Node.setProperty(String, Value, int) and setProperty(String, V= alue[], int): type argument was ignored in certain situations Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl= .java incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Val= ueHelper.java Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/No= deImpl.java URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/= apache/jackrabbit/core/NodeImpl.java?rev=3D164066&r1=3D164065&r2=3D164066&v= iew=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl= .java (original) +++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl= .java Thu Apr 21 07:26:11 2005 @@ -1858,7 +1858,11 @@ BitSet status =3D new BitSet(); PropertyImpl prop =3D getOrCreateProperty(name, type, true, status= ); try { - prop.setValue(values); + if (type =3D=3D PropertyType.UNDEFINED) { + prop.setValue(values); + } else { + prop.setValue(ValueHelper.convert(values, type)); + } } catch (RepositoryException re) { if (status.get(CREATED)) { // setting value failed, get rid of newly created property @@ -1994,7 +1998,11 @@ BitSet status =3D new BitSet(); PropertyImpl prop =3D getOrCreateProperty(name, type, false, statu= s); try { - prop.setValue(value); + if (type =3D=3D PropertyType.UNDEFINED) { + prop.setValue(value); + } else { + prop.setValue(ValueHelper.convert(value, type)); + } } catch (RepositoryException re) { if (status.get(CREATED)) { // setting value failed, get rid of newly created property Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ut= il/ValueHelper.java URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/= apache/jackrabbit/core/util/ValueHelper.java?rev=3D164066&r1=3D164065&r2=3D= 164066&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Val= ueHelper.java (original) +++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Val= ueHelper.java Thu Apr 21 07:26:11 2005 @@ -89,6 +89,25 @@ } =20 /** + * @param srcValues + * @param targetType + * @return + * @throws ValueFormatException + * @throws IllegalArgumentException + */ + public static Value[] convert(Value[] srcValues, int targetType) + throws ValueFormatException, IllegalArgumentException { + if (srcValues =3D=3D null) { + return null; + } + Value[] newValues =3D new Value[srcValues.length]; + for (int i =3D 0; i < srcValues.length; i++) { + newValues[i] =3D convert(srcValues[i], targetType); + } + return newValues; + } + + /** * @param srcValue * @param targetType * @return