You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ju...@apache.org on 2008/01/31 13:12:13 UTC

svn commit: r617115 - /james/server/sandbox/james-jcr/src/main/java/org/apache/james/jcr/JCRStoreBean.java

Author: jukka
Date: Thu Jan 31 04:12:12 2008
New Revision: 617115

URL: http://svn.apache.org/viewvc?rev=617115&view=rev
Log:
james-jcr: Better not to collapse multivalued properties to
single-valued if they contain just one value. Client code is easier
to write if you always know whether a property is multi- or single-valued.

Modified:
    james/server/sandbox/james-jcr/src/main/java/org/apache/james/jcr/JCRStoreBean.java

Modified: james/server/sandbox/james-jcr/src/main/java/org/apache/james/jcr/JCRStoreBean.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/james-jcr/src/main/java/org/apache/james/jcr/JCRStoreBean.java?rev=617115&r1=617114&r2=617115&view=diff
==============================================================================
--- james/server/sandbox/james-jcr/src/main/java/org/apache/james/jcr/JCRStoreBean.java (original)
+++ james/server/sandbox/james-jcr/src/main/java/org/apache/james/jcr/JCRStoreBean.java Thu Jan 31 04:12:12 2008
@@ -218,11 +218,7 @@
     private void setProperty(Node node, String name, String[] values)
             throws RepositoryException {
         if (values != null && values.length > 0) {
-            if (values.length == 1) {
-                node.setProperty(name, values[0]);
-            } else {
-                node.setProperty(name, values);
-            }
+            node.setProperty(name, values);
         }
     }
 
@@ -270,15 +266,11 @@
     private void setProperty(Node node, String name, Address[] values)
             throws RepositoryException {
         if (values != null && values.length > 0) {
-            if (values.length == 1) {
-                node.setProperty(name, values[0].toString());
-            } else {
-                String[] strings = new String[values.length];
-                for (int i = 0; i < values.length; i++) {
-                    strings[i] = values[i].toString();
-                }
-                node.setProperty(name, strings);
+            String[] strings = new String[values.length];
+            for (int i = 0; i < values.length; i++) {
+                strings[i] = values[i].toString();
             }
+            node.setProperty(name, strings);
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org