jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r762371 - in /jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value: NameValue.java PathValue.java
Date Mon, 06 Apr 2009 14:57:19 GMT
Author: jukka
Date: Mon Apr  6 14:57:19 2009
New Revision: 762371

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

Use the name and path format checkers from jackrabbit-jcr-commons. They're deprecated, but
I don't want to introduce a dependency from JCR-RMI to spi-commons.

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

Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/NameValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/NameValue.java?rev=762371&r1=762370&r2=762371&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/NameValue.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/NameValue.java
Mon Apr  6 14:57:19 2009
@@ -22,6 +22,9 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
 
+import org.apache.jackrabbit.name.IllegalNameException;
+import org.apache.jackrabbit.name.NameFormat;
+
 /**
  * The <code>NameValue</code> class implements the committed value state for
  * Name values as a part of the State design pattern (Gof) used by this package.
@@ -56,8 +59,12 @@
      *      synthactically correct name.
      */
     protected static String toName(String value) throws ValueFormatException {
-        // TODO: check syntax
-        return value;
+        try {
+            NameFormat.checkFormat(value);
+            return value;
+        } catch (IllegalNameException e) {
+            throw new ValueFormatException("Invalid name: " + value, e);
+        }
     }
 
     /**

Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/PathValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/PathValue.java?rev=762371&r1=762370&r2=762371&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/PathValue.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/value/PathValue.java
Mon Apr  6 14:57:19 2009
@@ -22,6 +22,9 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
 
+import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.name.PathFormat;
+
 /**
  * The <code>PathValue</code> class implements the committed value state for
  * Path values as a part of the State design pattern (Gof) used by this package.
@@ -56,8 +59,12 @@
      *      synthactically correct path.
      */
     protected static String toPath(String value) throws ValueFormatException {
-        // TODO: check syntax
-        return value;
+        try {
+            PathFormat.checkFormat(value);
+            return value;
+        } catch (MalformedPathException e) {
+            throw new ValueFormatException("Invalid path: " + value, e);
+        }
     }
 
     /**



Mime
View raw message