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 09:51:55 UTC
svn commit: r488157 -
/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
Author: jukka
Date: Mon Dec 18 00:51:54 2006
New Revision: 488157
URL: http://svn.apache.org/viewvc?view=rev&rev=488157
Log:
JCR-681: Avoid NullPointerExceptions in makeSerialValue()
Modified:
jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java?view=diff&rev=488157&r1=488156&r2=488157
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java Mon Dec 18 00:51:54 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);
}