jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r484644 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java
Date Fri, 08 Dec 2006 15:35:57 GMT
Author: stefan
Date: Fri Dec  8 07:35:55 2006
New Revision: 484644

URL: http://svn.apache.org/viewvc?view=rev&rev=484644
Log:
JCR-659

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java?view=diff&rev=484644&r1=484643&r2=484644
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java
Fri Dec  8 07:35:55 2006
@@ -133,18 +133,23 @@
         }
 
         // multi- or single-valued property?
-        if (va.length == 1) {
-            // could be single- or multi-valued (n == 1)
+        if (va.length == 1 && !def.isMultiple()) {
+            Exception e = null;
             try {
-                // try setting single-value
+                // set single-value
                 node.setProperty(name, va[0]);
             } catch (ValueFormatException vfe) {
-                // try setting value array
-                node.setProperty(name, va, type);
+                e = vfe;
             } catch (ConstraintViolationException cve) {
-                // try setting value array
+                e = cve;
+            }
+            if (e != null) {
+                // setting single-value failed, try setting value array
+                // as a last resort (in case there are ambiguous property
+                // definitions)
                 node.setProperty(name, va, type);
             }
+            //
         } else {
             // can only be multi-valued (n == 0 || n > 1)
             node.setProperty(name, va, type);



Mime
View raw message