[exo-jcr-commits] exo-jcr SVN: r117 - jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Sep 1 04:09:50 EDT 2009


Author: nzamosenchuk
Date: 2009-09-01 04:09:50 -0400 (Tue, 01 Sep 2009)
New Revision: 117

Modified:
   jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/LocationFactory.java
Log:
EXOJCR-21 : LocationFactory update to show exception more informative (invalid path is now being quoted to show when empty string is given).

Modified: jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/LocationFactory.java
===================================================================
--- jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/LocationFactory.java	2009-08-31 15:06:37 UTC (rev 116)
+++ jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/LocationFactory.java	2009-09-01 08:09:50 UTC (rev 117)
@@ -199,12 +199,12 @@
          int indexEnd = name.indexOf("]");
          if ((indexEnd <= indexStart + 1) || (indexEnd != name.length() - 1))
          {
-            throw new RepositoryException("Invalid path entry " + name);
+            throw new RepositoryException("Invalid path entry: \"" + name + "\"");
          }
          index = Integer.parseInt(name.substring(indexStart + 1, indexEnd));
          if (index <= 0)
          {
-            throw new RepositoryException("Invalid path entry " + name);
+            throw new RepositoryException("Invalid path entry: \"" + name + "\"");
          }
          endOfName = indexStart;
       }
@@ -222,7 +222,7 @@
             prefix = name.substring(0, delim);
             if (!XMLChar.isValidName(prefix))
             {
-               throw new RepositoryException("Illegal path entry " + name);
+               throw new RepositoryException("Illegal path entry: \"" + name + "\"");
             }
          }
 
@@ -230,7 +230,7 @@
          String someName = name.substring(delim + 1, endOfName);
          if (!isValidName(someName, !prefix.equals("")))
          {
-            throw new RepositoryException("Illegal path entry " + name);
+            throw new RepositoryException("Illegal path entry: \"" + name + "\"");
          }
 
          path.addEntry(namespaces.getNamespaceURIByPrefix(prefix), someName, prefix, index);
@@ -248,7 +248,7 @@
 
       if ((path == null) || (path.equals("")))
       {
-         throw new RepositoryException("Illegal relPath " + path);
+         throw new RepositoryException("Illegal relPath: \"" + path + "\"");
       }
 
       JCRPath jcrPath = new JCRPath();
@@ -261,7 +261,7 @@
       {
          if (!absolute)
          {
-            throw new RepositoryException("Illegal relPath " + path);
+            throw new RepositoryException("Illegal relPath: \"" + path + "\"");
          }
          jcrPath.addEntry(namespaces.getNamespaceURIByPrefix(""), "", "", -1);
       }
@@ -269,7 +269,7 @@
       {
          if (absolute)
          {
-            throw new RepositoryException("Illegal absPath " + path);
+            throw new RepositoryException("Illegal absPath: \"" + path + "\"");
          }
       }
 
@@ -305,7 +305,7 @@
    {
       if (ch == '|')
       {
-         log.warn("Path entry " + str + " contain illegal char " + ch);
+         log.warn("Path entry: \"" + str + "\" contain illegal char: \"" + ch + "\"");
       }
 
       return !((ch == '\t') || (ch == '\n') || (ch == '\f') || (ch == '\r') || (ch == ' ') || (ch == '/')



More information about the exo-jcr-commits mailing list