jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1350965 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: namepath/JcrNameParser.java namepath/NamePathMapperImpl.java plugins/name/NamespaceRegistryImpl.java plugins/name/Namespaces.java
Date Sat, 16 Jun 2012 17:13:02 GMT
Author: mduerig
Date: Sat Jun 16 17:13:01 2012
New Revision: 1350965

URL: http://svn.apache.org/viewvc?rev=1350965&view=rev
Log:
minor cleanup: fix Javadoc links, add private constructor to utility class, make utility methods
static

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/JcrNameParser.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/JcrNameParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/JcrNameParser.java?rev=1350965&r1=1350964&r2=1350965&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/JcrNameParser.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/JcrNameParser.java
Sat Jun 16 17:13:01 2012
@@ -20,7 +20,7 @@ import org.apache.jackrabbit.util.XMLCha
 
 /**
  * Parses and validates JCR names. Upon successful completion of
- * {@link #parse(String, org.apache.jackrabbit.oak.namepath.JcrNameParser.Listener)}
+ * {@link #parse(String, Listener, int)}
  * the specified listener is informed about the (resulting) JCR name.
  * In case of failure {@link Listener#error(String)} is called indicating
  * the reason.
@@ -44,15 +44,16 @@ public class JcrNameParser {
          * Informs this listener that parsing the jcr name failed.
          *
          * @param message Details about the error.
-         * @see JcrNameParser#parse(String, org.apache.jackrabbit.oak.namepath.JcrNameParser.Listener)
+         * @see JcrNameParser#parse(String, Listener, int)
          */
         void error(String message);
 
         /**
-         * Informs this listener about the result of {@link JcrNameParser#parse(String, org.apache.jackrabbit.oak.namepath.JcrNameParser.Listener)}
+         * Informs this listener about the result of
+         * {@link JcrNameParser#parse(String, Listener, int)}
          *
          * @param name The resulting name upon successful completion of
-         * {@link org.apache.jackrabbit.oak.namepath.JcrNameParser#parse(String, org.apache.jackrabbit.oak.namepath.JcrNameParser.Listener)}
+         * {@link org.apache.jackrabbit.oak.namepath.JcrNameParser#parse(String, Listener,
int)}
          * @param index the index (or {@code 0} when not specified)
          */
         boolean name(String name, int index);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java?rev=1350965&r1=1350964&r2=1350965&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
Sat Jun 16 17:13:01 2012
@@ -16,14 +16,14 @@
  */
 package org.apache.jackrabbit.oak.namepath;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.util.ArrayList;
 import java.util.List;
 
 import javax.annotation.Nonnull;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * NamePathMapperImpl...
  */
@@ -225,7 +225,7 @@ public class NamePathMapperImpl implemen
                     return false;
                 }
                 if (keepIndex && index > 0) {
-                    p += "[" + index + "]";
+                    p += "[" + index + ']';
                 }
                 elements.add(p);
                 return true;
@@ -261,7 +261,7 @@ public class NamePathMapperImpl implemen
         return oakPath.toString();
     }
 
-    private String removeTrailingSlash(String path) {
+    private static String removeTrailingSlash(String path) {
         if ("/".equals(path) || path.isEmpty()) {
             return path;
         } else if (path.endsWith("/")) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java?rev=1350965&r1=1350964&r2=1350965&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java
Sat Jun 16 17:13:01 2012
@@ -83,7 +83,7 @@ public class NamespaceRegistryImpl imple
         }
     }
 
-    private Tree getOrCreate(Root root, String... path) {
+    private static Tree getOrCreate(Root root, String... path) {
         Tree tree = root.getTree("/");
         for (String name : path) {
             Tree child = tree.getChild(name);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java?rev=1350965&r1=1350964&r2=1350965&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java
Sat Jun 16 17:13:01 2012
@@ -34,7 +34,10 @@ class Namespaces {
             new HashMap<String, String>();
 
     // TODO: this should not use the "jcr" prefix
-    public final static String NSMAPNODENAME = "jcr:namespaces";
+    public static final String NSMAPNODENAME = "jcr:namespaces";
+
+    private Namespaces() {
+    }
 
     static {
         // Standard namespace specified by JCR (default one not included)
@@ -75,11 +78,11 @@ class Namespaces {
 
     public static boolean isValidPrefix(String prefix) {
         // TODO: Other prefix rules?
-        return prefix.length() > 0 && prefix.indexOf(':') == -1;
+        return !prefix.isEmpty() && prefix.indexOf(':') == -1;
     }
 
     public static boolean isValidLocalName(String local) {
-        if (local.length() == 0 || ".".equals(local) || "..".equals(local)) {
+        if (local.isEmpty() || ".".equals(local) || "..".equals(local)) {
             return false;
         }
 



Mime
View raw message