jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r762322 - /jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java
Date Mon, 06 Apr 2009 13:14:58 GMT
Author: jukka
Date: Mon Apr  6 13:14:57 2009
New Revision: 762322

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

Better handling of property removals through set-to-null calls.

Modified:
    jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.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=762322&r1=762321&r2=762322&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 13:14:57 2009
@@ -541,9 +541,15 @@
     public Property setProperty(String name, Value[] values, int type)
             throws RepositoryException {
         try {
-            Value[] serials = SerialValueFactory.makeSerialValueArray(values);
-            RemoteProperty property = remote.setProperty(name, serials, type);
-            return getFactory().getProperty(getSession(), property);
+            if (values != null) {
+                values = SerialValueFactory.makeSerialValueArray(values);
+            }
+            RemoteProperty property = remote.setProperty(name, values, type);
+            if (property != null) {
+                return getFactory().getProperty(getSession(), property);
+            } else {
+                return null;
+            }
         } catch (RemoteException ex) {
             throw new RemoteRepositoryException(ex);
         }
@@ -553,18 +559,28 @@
     public Property setProperty(String name, Value value, int type)
             throws RepositoryException {
         try {
-            RemoteProperty property =
-                    remote.setProperty(name, SerialValueFactory.makeSerialValue(value), type);
-            return getFactory().getProperty(getSession(), property);
+            if (value != null) {
+                value = SerialValueFactory.makeSerialValue(value);
+            }
+            RemoteProperty property = remote.setProperty(name, value, type);
+            if (property != null) {
+                return getFactory().getProperty(getSession(), property);
+            } else {
+                return null;
+            }
         } catch (RemoteException ex) {
             throw new RemoteRepositoryException(ex);
         }
     }
 
     /** {@inheritDoc} */
-    public Property setProperty(String name, String value, int type)
+    public Property setProperty(String name, String string, int type)
             throws RepositoryException {
-        return setProperty(name, getSession().getValueFactory().createValue(value), type);
+        Value value = null;
+        if (string != null) {
+            value = getSession().getValueFactory().createValue(string);
+        }
+        return setProperty(name, value, type);
     }
 
     /** {@inheritDoc} */



Mime
View raw message