jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r452804 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Date Wed, 04 Oct 2006 09:10:02 GMT
Author: angela
Date: Wed Oct  4 02:10:01 2006
New Revision: 452804

URL: http://svn.apache.org/viewvc?view=rev&rev=452804
Log:
assertion that target type is not UNDEFINED must be performed before qualified values are
created.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?view=diff&rev=452804&r1=452803&r2=452804
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Wed Oct  4 02:10:01 2006
@@ -1417,15 +1417,16 @@
         throws ConstraintViolationException, RepositoryException {
         QPropertyDefinition def = getApplicablePropertyDefinition(qName, type, true);
         int targetType = def.getRequiredType();
+        // make sure, the final type is not set to undefined        
         if (targetType == PropertyType.UNDEFINED) {
-            targetType = type;
+            if (type == PropertyType.UNDEFINED) {
+                targetType = (values.length > 0) ? values[0].getType() : PropertyType.STRING;
+            } else {
+                targetType = type;
+            }
         }
         Value[] targetValues = ValueHelper.convert(values, targetType, session.getValueFactory());
         QValue[] qvs = ValueFormat.getQValues(targetValues, session.getNamespaceResolver());
-        // make sure, the final type is not set to undefined
-        if (targetType == PropertyType.UNDEFINED) {
-            targetType = (qvs.length > 0) ? qvs[0].getType() : PropertyType.STRING;
-        }
         return createProperty(qName, targetType, def, qvs);
     }
 



Mime
View raw message