jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r762311 - in /jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client: ClientNode.java ClientProperty.java
Date Mon, 06 Apr 2009 12:37:51 GMT
Author: jukka
Date: Mon Apr  6 12:37:51 2009
New Revision: 762311

URL: http://svn.apache.org/viewvc?rev=762311&view=rev
Log:
JCRRMI-17: Multiple TCK test failures

Multivalued setValue() calls may contain null entries in the value array. Skip those already
on the client side.

Modified:
    jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java
    jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java

Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java?rev=762311&r1=762310&r2=762311&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java
Mon Apr  6 12:37:51 2009
@@ -18,7 +18,9 @@
 
 import java.io.InputStream;
 import java.rmi.RemoteException;
+import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.List;
 
 import javax.jcr.Item;
 import javax.jcr.ItemVisitor;
@@ -155,11 +157,15 @@
         if (strings == null) {
             return setProperty(name, (Value[]) null);
         } else {
-            Value[] values = new Value[strings.length];
+            List values = new ArrayList();
             for (int i = 0; i < strings.length; i++) {
-                values[i] = getSession().getValueFactory().createValue(strings[i]);
+                if (strings[i] != null) {
+                    values.add(getSession().getValueFactory().createValue(
+                            strings[i]));
+                }
             }
-            return setProperty(name, values);
+            return setProperty(
+                    name, (Value[]) values.toArray(new Value[values.size()]));
         }
     }
 

Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java?rev=762311&r1=762310&r2=762311&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientProperty.java
Mon Apr  6 12:37:51 2009
@@ -18,7 +18,9 @@
 
 import java.io.InputStream;
 import java.rmi.RemoteException;
+import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.List;
 
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.ItemVisitor;
@@ -28,6 +30,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Value;
+import javax.jcr.ValueFactory;
 import javax.jcr.ValueFormatException;
 import javax.jcr.nodetype.PropertyDefinition;
 
@@ -247,11 +250,14 @@
         if (strings == null) {
             setValue((Value[]) null);
         } else {
-            Value[] values = new Value[strings.length];
+            ValueFactory factory = getSession().getValueFactory();
+            List values = new ArrayList(strings.length);
             for (int i = 0; i < strings.length; i++) {
-                values[i] = getSession().getValueFactory().createValue(strings[i]);
+                if (strings[i] != null) {
+                    values.add(factory.createValue(strings[i]));
+                }
             }
-            setValue(values);
+            setValue((Value[]) values.toArray(new Value[values.size()]));
         }
     }
 



Mime
View raw message