jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r762315 - in /jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value: SerialValueFactory.java StringValue.java
Date Mon, 06 Apr 2009 12:41:46 GMT
Author: jukka
Date: Mon Apr  6 12:41:46 2009
New Revision: 762315

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

Should throw ValueFormatException for invalid date strings.

Avoid nulls in value arrays.

Modified:
    jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
    jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/StringValue.java

Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java?rev=762315&r1=762314&r2=762315&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
Mon Apr  6 12:41:46 2009
@@ -17,7 +17,9 @@
 package org.apache.jackrabbit.rmi.value;
 
 import java.io.InputStream;
+import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.List;
 
 import javax.jcr.Node;
 import javax.jcr.PropertyType;
@@ -68,15 +70,15 @@
      * @return array of decorated values
      */
     public static Value[] makeSerialValueArray(Value[] values) {
+        List serials = new ArrayList();
         if (values != null) {
-            Value[] serials = new Value[values.length];
             for (int i = 0; i < values.length; i++) {
-                serials[i] = makeSerialValue(values[i]);
+                if (values[i] != null) {
+                    serials.add(makeSerialValue(values[i]));
+                }
             }
-            return serials;
-        } else {
-            return new Value[0];
         }
+        return (Value[]) serials.toArray(new Value[serials.size()]);
     }
 
     /**

Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/StringValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/StringValue.java?rev=762315&r1=762314&r2=762315&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/StringValue.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/StringValue.java
Mon Apr  6 12:41:46 2009
@@ -89,7 +89,12 @@
      *      <code>Calendar</code> instance.
      */
     public Calendar getDate() throws ValueFormatException {
-        return ISO8601.parse(value);
+        Calendar date = ISO8601.parse(value);
+        if (date != null) {
+            return date;
+        } else {
+            throw new ValueFormatException("Invalid date value: " + value);
+        }
     }
 
     /**



Mime
View raw message