You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2006/12/18 22:30:55 UTC

svn commit: r488426 - /jackrabbit/branches/1.2/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java

Author: jukka
Date: Mon Dec 18 13:30:55 2006
New Revision: 488426

URL: http://svn.apache.org/viewvc?view=rev&rev=488426
Log:
1.2: Merged revision 488157 (JCR-681)

Modified:
    jackrabbit/branches/1.2/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java

Modified: jackrabbit/branches/1.2/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java?view=diff&rev=488426&r1=488425&r2=488426
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java (original)
+++ jackrabbit/branches/1.2/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java Mon Dec 18 13:30:55 2006
@@ -85,14 +85,14 @@
     /**
      * Utility method for decorating a value. Note that the contents of the
      * original values will only be copied when the decorators are serialized.
+     * Null referenced and already serializable values are passed as-is.
      *
-     * @param value the value to be decorated
-     * @return the decorated value
+     * @param value the value to be decorated, or <code>null</code>
+     * @return the decorated value, or <code>null</code>
      */
     public static Value makeSerialValue(Value value) {
-        // if the value is already serializable, just return it
-        // - or should we test for SerialValue ??
-        if (value instanceof SerialValue) {
+        // if the value is null or already serializable, just return it
+        if (value == null || value instanceof SerialValue) {
             return value;
         }
 
@@ -224,7 +224,7 @@
      * @throws ValueFormatException if the string is not a synthactically
      *      correct JCR path.
      */
-    protected PathValue createPathValue(String value) 
+    protected PathValue createPathValue(String value)
             throws ValueFormatException {
         return new PathValue(value);
     }
@@ -241,7 +241,7 @@
      * @throws ValueFormatException if the string is not a synthactically
      *      correct JCR reference.
      */
-    protected ReferenceValue createReferenceValue(String value) 
+    protected ReferenceValue createReferenceValue(String value)
             throws ValueFormatException {
         return new ReferenceValue(value);
     }