jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1166138 [6/12] - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/ jackrabbit-spi-commons/src/main/ja...
Date Wed, 07 Sep 2011 12:00:20 GMT
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java Wed Sep  7 12:00:14 2011
@@ -16,16 +16,16 @@
  */
 package org.apache.jackrabbit.spi.commons.name;
 
-import javax.jcr.Property;
-import javax.jcr.security.Privilege;
-
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NameFactory;
 
+import javax.jcr.Property;
+import javax.jcr.security.Privilege;
+
 /**
- * <code>NameConstants</code>...
+ * {@code NameConstants}...
  */
-public class NameConstants {
+public final class NameConstants {
 
     private static final NameFactory FACTORY = NameFactoryImpl.getInstance();
 
@@ -403,7 +403,7 @@ public class NameConstants {
     //-------------------------------< lifecycle related item name constants >
 
     /**
-     * <code>jcr:lifecyclePolicy</code>: This property is a reference to
+     * {@code jcr:lifecyclePolicy}: This property is a reference to
      * another node that contains lifecycle policy information.
      * @since JCR 2.0
      */
@@ -411,7 +411,7 @@ public class NameConstants {
         FACTORY.create(Name.NS_JCR_URI, "lifecyclePolicy");
 
     /**
-     * <code>jcr:currentLifecycleState</code>: This property is a string
+     * {@code jcr:currentLifecycleState}: This property is a string
      * identifying the current lifecycle state of this node.
      * @since JCR 2.0
      */
@@ -548,8 +548,8 @@ public class NameConstants {
     public static final Name NT_CHILDNODEDEFINITION = FACTORY.create(Name.NS_NT_URI, "childNodeDefinition");
 
     /**
-     * <code>mix:lifecycle</code>: Only nodes with mixin node type
-     * <code>mix:lifecycle</code> may participate in a lifecycle.
+     * {@code mix:lifecycle}: Only nodes with mixin node type
+     * {@code mix:lifecycle} may participate in a lifecycle.
      * @since JCR 2.0
      */
     public static final Name MIX_LIFECYCLE =
@@ -567,9 +567,12 @@ public class NameConstants {
      */
     public static final Name NT_CONFIGURATION = FACTORY.create(Name.NS_NT_URI, "configuration");
 
+    private NameConstants() {
+    }
+
     //--------------------------------------------------------------------------
 
-    private static final Name rep(String local) {
+    private static Name rep(String local) {
         return FACTORY.create(Name.NS_REP_URI, local);
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java Wed Sep  7 12:00:14 2011
@@ -16,11 +16,11 @@
  */
 package org.apache.jackrabbit.spi.commons.name;
 
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 
+import javax.jcr.RepositoryException;
+
 final class NamePath extends RelativePath {
 
     /** Serial version UID */
@@ -46,11 +46,13 @@ final class NamePath extends RelativePat
         this.index = index;
     }
 
+    @Override
     protected int getDepthModifier() {
         return 1;
     }
 
-    protected Path getParent() throws RepositoryException {
+    @Override
+    protected Path getParent() {
         if (parent != null) {
             return parent;
         } else {
@@ -58,14 +60,16 @@ final class NamePath extends RelativePat
         }
     }
 
+    @Override
     protected String getElementString() {
         if (index > Path.INDEX_DEFAULT) {
-            return name + "[" + index + "]";
+            return name + "[" + index + ']';
         } else {
             return name.toString();
         }
     }
 
+    @Override
     public Name getName() {
         return name;
     }
@@ -77,33 +81,36 @@ final class NamePath extends RelativePat
 
     @Override
     public int getNormalizedIndex() {
-        if (index != INDEX_UNDEFINED) {
-            return index;
-        } else {
+        if (index == INDEX_UNDEFINED) {
             return INDEX_DEFAULT;
+        } else {
+            return index;
         }
     }
 
     /**
-     * Returns <code>true</code> as this path ends in a named element.
+     * Returns {@code true} as this path ends in a named element.
      *
-     * @return <code>true</code>
+     * @return {@code true}
      */
     @Override
     public boolean denotesName() {
         return true;
     }
 
+    @Override
     public boolean isCanonical() {
         return parent != null && parent.isCanonical();
     }
 
+    @Override
     public boolean isNormalized() {
         return parent == null
-            || (parent.isNormalized()
-                    && !parent.denotesCurrent());
+            || parent.isNormalized()
+                    && !parent.denotesCurrent();
     }
 
+    @Override
     public Path getNormalizedPath() throws RepositoryException {
         if (isNormalized()) {
             return this;
@@ -117,6 +124,7 @@ final class NamePath extends RelativePat
         }
     }
 
+    @Override
     public Path getCanonicalPath() throws RepositoryException {
         if (isCanonical()) {
             return this;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java Wed Sep  7 12:00:14 2011
@@ -16,15 +16,13 @@
  */
 package org.apache.jackrabbit.spi.commons.name;
 
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 
+import javax.jcr.RepositoryException;
+
 /**
  * A relative path whose last element is the parent path element, i.e. "..".
- *
- * @see ParentElement
  */
 final class ParentPath extends RelativePath {
 
@@ -42,10 +40,12 @@ final class ParentPath extends RelativeP
         super(parent);
     }
 
+    @Override
     protected int getDepthModifier() {
         return -1;
     }
 
+    @Override
     protected Path getParent() throws RepositoryException {
         if (isNormalized()) {
             return new ParentPath(this);
@@ -54,18 +54,20 @@ final class ParentPath extends RelativeP
         }
     }
 
+    @Override
     protected String getElementString() {
         return NAME.getLocalName();
     }
 
+    @Override
     public Name getName() {
         return NAME;
     }
 
     /**
-     * Returns <code>true</code> as this path ends in the parent element.
+     * Returns {@code true} as this path ends in the parent element.
      *
-     * @return <code>true</code>
+     * @return {@code true}
      */
     @Override
     public boolean denotesParent() {
@@ -73,20 +75,23 @@ final class ParentPath extends RelativeP
     }
 
     /**
-     * Returns <code>false</code> as a path with a ".." element is
+     * Returns {@code false} as a path with a ".." element is
      * never canonical.
      *
-     * @return <code>false</code>
+     * @return {@code false}
      */
+    @Override
     public boolean isCanonical() {
         return false;
     }
 
+    @Override
     public boolean isNormalized() {
         return parent == null
-            || (parent.isNormalized() && parent.denotesParent());
+            || parent.isNormalized() && parent.denotesParent();
     }
 
+    @Override
     public Path getNormalizedPath() throws RepositoryException {
         if (isNormalized()) {
             return this;
@@ -103,6 +108,7 @@ final class ParentPath extends RelativeP
         }
     }
 
+    @Override
     public Path getCanonicalPath() throws RepositoryException {
         if (parent != null) {
             return parent.getCanonicalPath().getAncestor(1);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathBuilder.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathBuilder.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathBuilder.java Wed Sep  7 12:00:14 2011
@@ -28,8 +28,8 @@ import org.apache.jackrabbit.spi.commons
  * does it validate the format of the entire path.
  * This class should therefore only be used in situations, where the elements
  * and the resulting path are known to be valid. The regular way of creating
- * a <code>Path</code> object is by calling any of the
- * <code>PathFactory.create()</code>methods.
+ * a {@code Path} object is by calling any of the
+ * {@code PathFactory.create()}methods.
  */
 public final class PathBuilder {
 
@@ -41,7 +41,7 @@ public final class PathBuilder {
     /**
      * The current path
      */
-    private Path path = null;
+    private Path path;
 
     /**
      * Creates a new PathBuilder to create a Path using the
@@ -96,7 +96,7 @@ public final class PathBuilder {
     }
 
     /**
-     * Adds the given elemenets
+     * Adds the given elements
      *
      * @param elements
      */

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathFactoryImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathFactoryImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathFactoryImpl.java Wed Sep  7 12:00:14 2011
@@ -16,21 +16,19 @@
  */
 package org.apache.jackrabbit.spi.commons.name;
 
-import java.util.ArrayList;
-
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NameFactory;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.PathFactory;
 
+import javax.jcr.RepositoryException;
+import java.util.ArrayList;
+
 /**
- * <code>PathFactoryImpl</code>...
+ * {@code PathFactoryImpl}...
  */
 public class PathFactoryImpl implements PathFactory {
-
-    private static PathFactory FACTORY = new PathFactoryImpl();
+    private static final PathFactory FACTORY = new PathFactoryImpl();
 
     private PathFactoryImpl() {}
 
@@ -39,9 +37,11 @@ public class PathFactoryImpl implements 
     }
 
     //--------------------------------------------------------< PathFactory >---
+
     /**
      * @see PathFactory#create(Path, Path, boolean)
      */
+    @Override
     public Path create(Path parent, Path relPath, boolean normalize) throws IllegalArgumentException, RepositoryException {
         if (relPath.isAbsolute()) {
             throw new IllegalArgumentException(
@@ -59,6 +59,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#create(Path, Name, boolean)
      */
+    @Override
     public Path create(Path parent, Name name, boolean normalize) throws RepositoryException {
         return create(parent, name, Path.INDEX_UNDEFINED, normalize);
     }
@@ -66,6 +67,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#create(Path, Name, int, boolean)
      */
+    @Override
     public Path create(Path parent, Name name, int index, boolean normalize) throws IllegalArgumentException, RepositoryException {
         if (RootPath.NAME.equals(name)) {
             throw new IllegalArgumentException();
@@ -81,6 +83,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#create(Name)
      */
+    @Override
     public Path create(Name name) throws IllegalArgumentException {
         if (name != null) {
             return create(name, Path.INDEX_UNDEFINED);
@@ -92,12 +95,13 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#create(Name, int)
      */
+    @Override
     public Path create(Name name, int index) throws IllegalArgumentException {
         if (name == null) {
             throw new IllegalArgumentException("PathFactory.create(null, index");
         } else if (index < Path.INDEX_UNDEFINED) {
             throw new IllegalArgumentException(
-                    "Index must not be negative: " + name + "[" + index + "]");
+                    "Index must not be negative: " + name + '[' + index + ']');
         } else if (CurrentPath.NAME.equals(name)) {
             if (index == Path.INDEX_UNDEFINED) {
                 return CurrentPath.CURRENT_PATH;
@@ -121,6 +125,7 @@ public class PathFactoryImpl implements 
         }
     }
 
+    @Override
     public Path create(Path.Element element) {
         if (element.denotesCurrent()) {
             return CurrentPath.CURRENT_PATH;
@@ -141,6 +146,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#create(org.apache.jackrabbit.spi.Path.Element[])
      */
+    @Override
     public Path create(Path.Element[] elements) throws IllegalArgumentException {
         Path path = null;
         for (Path.Element element : elements) {
@@ -171,6 +177,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#create(String)
      */
+    @Override
     public Path create(String pathString) throws IllegalArgumentException {
         if (pathString == null || "".equals(pathString)) {
             throw new IllegalArgumentException("No Path literal specified");
@@ -197,6 +204,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#createElement(Name)
      */
+    @Override
     public Path.Element createElement(Name name) throws IllegalArgumentException {
         if (name == null) {
             throw new IllegalArgumentException("name must not be null");
@@ -214,10 +222,11 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#createElement(Name, int)
      */
+    @Override
     public Path.Element createElement(Name name, int index) throws IllegalArgumentException {
         if (index < Path.INDEX_UNDEFINED) {
             throw new IllegalArgumentException(
-                    "The index may not be negative: " + name + "[" + index + "]");
+                    "The index may not be negative: " + name + '[' + index + ']');
         } else if (name == null) {
             throw new IllegalArgumentException("The name must not be null");
         } else if (name.equals(ParentPath.NAME)
@@ -225,12 +234,13 @@ public class PathFactoryImpl implements 
                 || name.equals(RootPath.NAME)) {
             throw new IllegalArgumentException(
                     "Special path elements (root, '.' and '..') can not have an explicit index: "
-                    + name + "[" + index + "]");
+                    + name + '[' + index + ']');
         } else {
             return new NamePath(null, name, index);
         }
     }
 
+    @Override
     public Path.Element createElement(String identifier) throws IllegalArgumentException {
         if (identifier == null) {
             throw new IllegalArgumentException("The id must not be null.");
@@ -242,7 +252,7 @@ public class PathFactoryImpl implements 
     /**
      * Create an element from the element string
      */
-    private Path.Element createElementFromString(String elementString) {
+    private static Path.Element createElementFromString(String elementString) {
         if (elementString == null) {
             throw new IllegalArgumentException("null PathElement literal");
         }
@@ -275,13 +285,14 @@ public class PathFactoryImpl implements 
             }
             return new NamePath(null, name, index);
         } catch (NumberFormatException e) {
-            throw new IllegalArgumentException("invalid PathElement literal: " + elementString + " (" + e.getMessage() + ")");
+            throw new IllegalArgumentException("invalid PathElement literal: " + elementString + " (" + e.getMessage() + ')');
         }
     }
 
     /**
      * @see PathFactory#getCurrentElement()
      */
+    @Override
     public Path.Element getCurrentElement() {
         return CurrentPath.CURRENT_PATH;
     }
@@ -289,6 +300,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#getParentElement()
      */
+    @Override
     public Path.Element getParentElement() {
         return ParentPath.PARENT_PATH;
     }
@@ -296,6 +308,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#getRootElement()
      */
+    @Override
     public Path.Element getRootElement() {
         return RootPath.ROOT_PATH;
     }
@@ -303,6 +316,7 @@ public class PathFactoryImpl implements 
     /**
      * @see PathFactory#getRootPath()
      */
+    @Override
     public Path getRootPath() {
         return RootPath.ROOT_PATH;
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java Wed Sep  7 12:00:14 2011
@@ -21,10 +21,10 @@ import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
 
-import java.util.List;
-import java.util.Map;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -42,12 +42,12 @@ public class PathMap<T> {
         new Element<T>(PATH_FACTORY.getRootElement());
 
     /**
-     * Map a path to a child. If <code>exact</code> is <code>false</code>,
+     * Map a path to a child. If {@code exact} is {@code false},
      * returns the last available item along the path that is stored in the map.
      * @param path path to map
      * @param exact flag indicating whether an exact match is required
-     * @return child, maybe <code>null</code> if <code>exact</code> is
-     *         <code>true</code>
+     * @return child, maybe {@code null} if {@code exact} is
+     *         {@code true}
      */
     public Element<T> map(Path path, boolean exact) {
         Path.Element[] elements = path.getElements();
@@ -119,7 +119,7 @@ public class PathMap<T> {
     /**
      * Traverse the path map and call back requester. This method visits the root
      * first, then its children.
-     * @param includeEmpty if <code>true</code> invoke call back on every child
+     * @param includeEmpty if {@code true} invoke call back on every child
      *                     regardless, whether the associated object is empty
      *                     or not; otherwise call back on non-empty children
      *                     only
@@ -172,12 +172,12 @@ public class PathMap<T> {
          * @param nameIndex path element of this child
          */
         private Element(Path.Element nameIndex) {
-            this.index = nameIndex.getIndex();
+            index = nameIndex.getIndex();
             if (nameIndex.denotesName()) {
                 updatePathElement(nameIndex.getName(), index);
             } else {
                 // root, current or parent
-                this.pathElement = nameIndex;
+                pathElement = nameIndex;
             }
         }
 
@@ -232,7 +232,7 @@ public class PathMap<T> {
         /**
          * Return an element matching a name and index.
          * @param nameIndex position where child is located
-         * @return element matching <code>nameIndex</code> or <code>null</code> if
+         * @return element matching {@code nameIndex} or {@code null} if
          *         none exists.
          */
         private Element<T> getChild(Path.Element nameIndex) {
@@ -250,7 +250,7 @@ public class PathMap<T> {
         }
 
         /**
-         * Link a child of this node. Position is given by <code>nameIndex</code>.
+         * Link a child of this node. Position is given by {@code nameIndex}.
          * @param nameIndex position where child should be located
          * @param element element to add
          */
@@ -288,17 +288,17 @@ public class PathMap<T> {
          * element itself gets removed.
          *
          * @param nameIndex child's path element
-         * @return removed child, may be <code>null</code>
+         * @return removed child, may be {@code null}
          */
         public Element<T> remove(Path.Element nameIndex) {
             return remove(nameIndex, true, true);
         }
 
         /**
-         * Remove a child. If <code>shift</code> is set to <code>true</code>,
+         * Remove a child. If {@code shift} is set to {@code true},
          * will shift all children having an index greater than the child
-         * removed to the left. If <code>removeIfEmpty</code> is set to
-         * <code>true</code> and there are no more children left in
+         * removed to the left. If {@code removeIfEmpty} is set to
+         * {@code true} and there are no more children left in
          * this element and no object is associated with this element, the
          * element itself gets removed.
          *
@@ -308,7 +308,7 @@ public class PathMap<T> {
          * @param removeIfEmpty remove this element itself if it contains
          *                      no more children and is not associated to
          *                      an element
-         * @return removed child, may be <code>null</code>
+         * @return removed child, may be {@code null}
          */
         private Element<T> remove(Path.Element nameIndex, boolean shift,
                                boolean removeIfEmpty) {
@@ -384,8 +384,8 @@ public class PathMap<T> {
          * Sets a new list of children of this element.
          *
          * @param children map of children; keys are of type
-         *                 <code>Path.PathElement</code> and values
-         *                 are of type <code>Element</code>
+         *                 {@code Path.PathElement} and values
+         *                 are of type {@code Element}
          */
         public void setChildren(Map<Path.Element, Element<T>> children) {
             // Remove all children without removing the element itself
@@ -481,7 +481,7 @@ public class PathMap<T> {
 
         /**
          * Internal implementation of {@link #getPath()} that populates entries
-         * in a builder. On exit, <code>builder</code> contains the path
+         * in a builder. On exit, {@code builder} contains the path
          * of this element
          */
         private void getPath(PathBuilder builder) {
@@ -495,11 +495,11 @@ public class PathMap<T> {
 
         /**
          * Checks whether this element has the specified path. Introduced to
-         * avoid catching a <code>MalformedPathException</code> for simple
+         * avoid catching a {@code MalformedPathException} for simple
          * path comparisons.
          * @param path path to compare to
-         * @return <code>true</code> if this child has the path
-         *         <code>path</code>, <code>false</code> otherwise
+         * @return {@code true} if this child has the path
+         *         {@code path}, {@code false} otherwise
          */
         public boolean hasPath(Path path) {
             return hasPath(path.getElements(), path.getLength());
@@ -510,8 +510,8 @@ public class PathMap<T> {
          * path elements.
          * @param elements path elements to compare to
          * @param len number of elements to compare to
-         * @return <code>true</code> if this element has the path given;
-         *         otherwise <code>false</code>
+         * @return {@code true} if this element has the path given;
+         *         otherwise {@code false}
          */
         private boolean hasPath(Path.Element[] elements, int len) {
             if (getPathElement().equals(elements[len - 1])) {
@@ -534,7 +534,7 @@ public class PathMap<T> {
          * Recursively invoked traversal method. This method visits the element
          * first, then its children.
          * @param visitor visitor to invoke
-         * @param includeEmpty if <code>true</code> invoke call back on every
+         * @param includeEmpty if {@code true} invoke call back on every
          *        element regardless, whether the associated object is empty
          *        or not; otherwise call back on non-empty children only
          */
@@ -554,9 +554,9 @@ public class PathMap<T> {
         }
 
         /**
-         * Return the depth of this element. Defined to be <code>0</code> for the
-         * root element and <code>n + 1</code> for some element if the depth of
-         * its parent is <code>n</code>.
+         * Return the depth of this element. Defined to be {@code 0} for the
+         * root element and {@code n + 1} for some element if the depth of
+         * its parent is {@code n}.
          */
         public int getDepth() {
             if (parent != null) {
@@ -584,7 +584,7 @@ public class PathMap<T> {
 
         /**
          * Return the parent of this element
-         * @return parent or <code>null</code> if this is the root element
+         * @return parent or {@code null} if this is the root element
          */
         public Element<T> getParent() {
             return parent;
@@ -617,21 +617,21 @@ public class PathMap<T> {
         }
 
         /**
-         * Map a relPath starting at <code>this</code> Element. If
-         * <code>exact</code> is <code>false</code>, returns the last available
+         * Map a relPath starting at {@code this} Element. If
+         * {@code exact} is {@code false}, returns the last available
          * item along the relPath that is stored in the map.
          *
          * @param relPath relPath to map
          * @param exact   flag indicating whether an exact match is required
-         * @return descendant, maybe <code>null</code> if <code>exact</code> is
-         *         <code>true</code>
+         * @return descendant, maybe {@code null} if {@code exact} is
+         *         {@code true}
          */
         public Element<T> getDescendant(Path relPath, boolean exact) {
             Path.Element[] elements = relPath.getElements();
             Element<T> current = this;
 
-            for (int i = 0; i < elements.length; i++) {
-                Element<T> next = current.getChild(elements[i]);
+            for (Path.Element element : elements) {
+                Element<T> next = current.getChild(element);
                 if (next == null) {
                     if (exact) {
                         return null;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/Pattern.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/Pattern.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/Pattern.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/Pattern.java Wed Sep  7 12:00:14 2011
@@ -16,12 +16,12 @@
  */
 package org.apache.jackrabbit.spi.commons.name;
 
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.Path.Element;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Pattern to match normalized {@link Path}s.
  * A pattern matches either a constant path, a name of a path element, a selection of
@@ -36,8 +36,8 @@ public abstract class Pattern {
     /**
      * Matches this pattern against the input.
      * @param input path to match with this pattern
-     * @return result from the matching <code>pattern</code> against <code>input</code>
-     * @throws IllegalArgumentException if <code>input</code> is not normalized
+     * @return result from the matching {@code pattern} against {@code input}
+     * @throws IllegalArgumentException if {@code input} is not normalized
      */
     public MatchResult match(Path input) {
         try {
@@ -54,8 +54,8 @@ public abstract class Pattern {
     /**
      * Construct a new pattern which matches an exact path
      * @param path
-     * @return A pattern which matches <code>path</code> and nothing else
-     * @throws IllegalArgumentException if <code>path</code> is <code>null</code>
+     * @return A pattern which matches {@code path} and nothing else
+     * @throws IllegalArgumentException if {@code path} is {@code null}
      */
     public static Pattern path(Path path) {
         if (path == null) {
@@ -67,8 +67,8 @@ public abstract class Pattern {
     /**
      * Construct a new pattern which matches a path element of a given name
      * @param name
-     * @return A pattern which matches a path element with name <code>name</code>
-     * @throws IllegalArgumentException if <code>name</code> is <code>null</code>
+     * @return A pattern which matches a path element with name {@code name}
+     * @throws IllegalArgumentException if {@code name} is {@code null}
      */
     public static Pattern name(Name name) {
         if (name == null) {
@@ -83,11 +83,11 @@ public abstract class Pattern {
      *   a path element.
      * @param localName A regular expression used for matching the local name of a path
      *   element
-     * @return  A pattern which matches a path element if namespaceUri matches the
+     * @return A pattern which matches a path element if namespaceUri matches the
      *   name space URI of the path element and localName matches the local name of the
      *   path element.
-     * @throws IllegalArgumentException if either <code>namespaceUri</code> or
-     *   <code>localName</code> is <code>null</code>
+     * @throws IllegalArgumentException if either {@code namespaceUri} or
+     *   {@code localName} is {@code null}
      *
      * @see java.util.regex.Pattern
      */
@@ -99,6 +99,7 @@ public abstract class Pattern {
     }
 
     private static final Pattern ALL_PATTERN = new Pattern() {
+        @Override
         protected Context match(Context input) {
             return input.matchToEnd();
         }
@@ -118,6 +119,7 @@ public abstract class Pattern {
     }
 
     private static final Pattern NOTHING_PATTERN = new Pattern() {
+        @Override
         protected Context match(Context input) {
             return input.match(0);
         }
@@ -136,12 +138,12 @@ public abstract class Pattern {
     }
 
     /**
-     * A pattern which matches <code>pattern1</code> followed by <code>pattern2</code> and
+     * A pattern which matches {@code pattern1} followed by {@code pattern2} and
      * returns the longer of the two matches.
      * @param pattern1
      * @param pattern2
      * @return
-     * @throws IllegalArgumentException if either argument is <code>null</code>
+     * @throws IllegalArgumentException if either argument is {@code null}
      */
     public static Pattern selection(Pattern pattern1, Pattern pattern2) {
         if (pattern1 == null || pattern2 == null) {
@@ -151,7 +153,7 @@ public abstract class Pattern {
     }
 
     /**
-     * A pattern which matches <code>pattern1</code> followed by <code>pattern2</code>.
+     * A pattern which matches {@code pattern1} followed by {@code pattern2}.
      * @param pattern1
      * @param pattern2
      * @return
@@ -164,7 +166,7 @@ public abstract class Pattern {
     }
 
     /**
-     * A pattern which matches <code>pattern</code> as many times as possible
+     * A pattern which matches {@code pattern} as many times as possible
      * @param pattern
      * @return
      */
@@ -176,8 +178,8 @@ public abstract class Pattern {
     }
 
     /**
-     * A pattern which matches <code>pattern</code> as many times as possible
-     * but at least <code>min</code> times and at most <code>max</code> times.
+     * A pattern which matches {@code pattern} as many times as possible
+     * but at least {@code min} times and at most {@code max} times.
      * @param pattern
      * @param min
      * @param max
@@ -199,7 +201,6 @@ public abstract class Pattern {
         private final boolean isMatch;
 
         public Context(Path path) {
-            super();
             this.path = path;
             length = path.getLength();
             isMatch = false;
@@ -210,7 +211,7 @@ public abstract class Pattern {
             path = context.path;
             length = context.length;
             this.pos = pos;
-            this.isMatch = matched;
+            isMatch = matched;
             if (pos > length) {
                 throw new IllegalArgumentException("Cannot match beyond end of input");
             }
@@ -225,7 +226,7 @@ public abstract class Pattern {
         }
 
         public Context noMatch() {
-            return new Context(this, this.pos, false);
+            return new Context(this, pos, false);
         }
 
         public boolean isMatch() {
@@ -262,11 +263,11 @@ public abstract class Pattern {
         private final Pattern pattern2;
 
         public SelectPattern(Pattern pattern1, Pattern pattern2) {
-            super();
             this.pattern1 = pattern1;
             this.pattern2 = pattern2;
         }
 
+        @Override
         protected Context match(Context input) throws RepositoryException {
             Context remainder1 = pattern1.match(input);
             Context remainder2 = pattern2.match(input);
@@ -276,11 +277,11 @@ public abstract class Pattern {
 
         public String toString() {
             return new StringBuffer()
-                .append("(")
+                .append('(')
                 .append(pattern1)
-                .append("|")
+                .append('|')
                 .append(pattern2)
-                .append(")")
+                .append(')')
             .toString();
         }
     }
@@ -292,11 +293,11 @@ public abstract class Pattern {
         private final Pattern pattern2;
 
         public SequencePattern(Pattern pattern1, Pattern pattern2) {
-            super();
             this.pattern1 = pattern1;
             this.pattern2 = pattern2;
         }
 
+        @Override
         protected Context match(Context input) throws RepositoryException {
             Context context1 = pattern1.match(input);
             if (context1.isMatch()) {
@@ -309,11 +310,11 @@ public abstract class Pattern {
 
         public String toString() {
             return new StringBuffer()
-                .append("(")
+                .append('(')
                 .append(pattern1)
                 .append(", ")
                 .append(pattern2)
-                .append(")")
+                .append(')')
             .toString();
         }
     }
@@ -328,17 +329,17 @@ public abstract class Pattern {
 
         public RepeatPattern(Pattern pattern) {
             this(pattern, 0, 0);
-            this.hasBounds = false;
+            hasBounds = false;
         }
 
         public RepeatPattern(Pattern pattern, int min, int max) {
-            super();
             this.pattern = pattern;
             this.min = min;
             this.max = max;
-            this.hasBounds = true;
+            hasBounds = true;
         }
 
+        @Override
         protected Context match(Context input) throws RepositoryException {
             Context nextInput;
             Context output = input.match(0);
@@ -347,9 +348,9 @@ public abstract class Pattern {
                 nextInput = output;
                 output = pattern.match(nextInput);
                 matchCount++;
-            } while (output.isMatch() && (output.pos > nextInput.pos));
+            } while (output.isMatch() && output.pos > nextInput.pos);
 
-            if (!hasBounds() || (min <= matchCount && matchCount <= max)) {
+            if (!hasBounds() || min <= matchCount && matchCount <= max) {
                 return nextInput;
             }
             else {
@@ -363,7 +364,7 @@ public abstract class Pattern {
 
         public String toString() {
             return new StringBuffer()
-                .append("(")
+                .append('(')
                 .append(pattern)
                 .append(")*")
             .toString();
@@ -378,11 +379,11 @@ public abstract class Pattern {
         private final Element[] patternElements;
 
         public PathPattern(Path path) {
-            super();
             this.path = path;
             patternElements = path.getElements();
         }
 
+        @Override
         protected Context match(Context input) throws RepositoryException {
             if (input.isExhausted()) {
                 return input;
@@ -411,9 +412,9 @@ public abstract class Pattern {
 
         public String toString() {
             return new StringBuffer()
-                .append("\"")
+                .append('\"')
                 .append(path)
-                .append("\"")
+                .append('\"')
             .toString();
         }
     }
@@ -423,6 +424,7 @@ public abstract class Pattern {
     private static abstract class AbstractNamePattern extends Pattern {
         protected abstract boolean matches(Element element);
 
+        @Override
         protected Context match(Context input) throws RepositoryException {
             if (input.isExhausted()) {
                 return input.noMatch();
@@ -449,19 +451,19 @@ public abstract class Pattern {
         private final Name name;
 
         public NamePattern(Name name) {
-            super();
             this.name = name;
         }
 
+        @Override
         protected boolean matches(Element element) {
             return name.equals(element.getName());
         }
 
         public String toString() {
             return new StringBuffer()
-                .append("\"")
+                .append('\"')
                 .append(name)
-                .append("\"")
+                .append('\"')
             .toString();
         }
     }
@@ -475,14 +477,13 @@ public abstract class Pattern {
         private final String namespaceUriStr;
 
         public RegexPattern(String namespaceUri, String localName) {
-            super();
-
             this.namespaceUri = java.util.regex.Pattern.compile(namespaceUri);
             this.localName = java.util.regex.Pattern.compile(localName);
-            this.namespaceUriStr = namespaceUri;
-            this.localNameStr = localName;
+            namespaceUriStr = namespaceUri;
+            localNameStr = localName;
         }
 
+        @Override
         protected boolean matches(Element element) {
             Name name = element.getName();
             boolean nsMatches = namespaceUri.matcher(name.getNamespaceURI()).matches();
@@ -494,9 +495,9 @@ public abstract class Pattern {
             return new StringBuffer()
                 .append("\"{")
                 .append(namespaceUriStr)
-                .append("}")
+                .append('}')
                 .append(localNameStr)
-                .append("\"")
+                .append('\"')
             .toString();
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java Wed Sep  7 12:00:14 2011
@@ -16,10 +16,10 @@
  */
 package org.apache.jackrabbit.spi.commons.name;
 
-import javax.jcr.RepositoryException;
-
 import org.apache.jackrabbit.spi.Path;
 
+import javax.jcr.RepositoryException;
+
 abstract class RelativePath extends AbstractPath {
 
     /** Serial version UID */
@@ -38,15 +38,15 @@ abstract class RelativePath extends Abst
     protected RelativePath(Path parent) {
         this.parent = parent;
         if (parent != null) {
-            this.absolute = parent.isAbsolute();
-            this.identifier = parent.isIdentifierBased();
-            this.depth = parent.getDepth() + getDepthModifier();
-            this.length = parent.getLength() + 1;
-        } else {
-            this.absolute = false;
-            this.identifier = false;
-            this.depth = getDepthModifier();
-            this.length = 1;
+            absolute = parent.isAbsolute();
+            identifier = parent.isIdentifierBased();
+            depth = parent.getDepth() + getDepthModifier();
+            length = parent.getLength() + 1;
+        } else {
+            absolute = false;
+            identifier = false;
+            depth = getDepthModifier();
+            length = 1;
         }
     }
 
@@ -56,14 +56,17 @@ abstract class RelativePath extends Abst
 
     protected abstract String getElementString();
 
+    @Override
     public final boolean isIdentifierBased() {
         return identifier;
     }
 
+    @Override
     public final boolean isAbsolute() {
         return absolute;
     }
 
+    @Override
     public final Path getAncestor(int degree) throws RepositoryException {
         if (degree < 0) {
             throw new IllegalArgumentException(
@@ -75,6 +78,7 @@ abstract class RelativePath extends Abst
         }
     }
 
+    @Override
     public final int getAncestorCount() {
         if (absolute) {
             return depth;
@@ -83,18 +87,21 @@ abstract class RelativePath extends Abst
         }
     }
 
+    @Override
     public final int getDepth() {
         return depth;
     }
 
+    @Override
     public final int getLength() {
         return length;
     }
 
+    @Override
     public final Path subPath(int from, int to) {
         if (from < 0 || length < to || to <= from) {
             throw new IllegalArgumentException(
-                    this + ".subPath(" + from + ", " + to + ")");
+                    this + ".subPath(" + from + ", " + to + ')');
         } else if (from == 0 && to == length) {
             // this is only case where parent can be null (from = 0, to = 1)
             return this;
@@ -107,6 +114,7 @@ abstract class RelativePath extends Abst
         }
     }
 
+    @Override
     public final Element[] getElements() {
         Element[] elements = new Element[length];
         Path path = this;
@@ -120,13 +128,14 @@ abstract class RelativePath extends Abst
     /**
      * Returns the first elements of this path.
      *
-     * @return first elements of this path, or <code>null</code>
+     * @return first elements of this path, or {@code null}
      */
     @Override
     public Path getFirstElements() {
         return parent;
     }
 
+    @Override
     public String getString() {
         if (parent != null) {
             return parent.getString() + Path.DELIMITER + getElementString();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RootPath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RootPath.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RootPath.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RootPath.java Wed Sep  7 12:00:14 2011
@@ -16,11 +16,11 @@
  */
 package org.apache.jackrabbit.spi.commons.name;
 
-import javax.jcr.PathNotFoundException;
-
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 
+import javax.jcr.PathNotFoundException;
+
 final class RootPath extends AbstractPath {
 
     /** Singleton instance */
@@ -37,14 +37,15 @@ final class RootPath extends AbstractPat
     private RootPath() {
     }
 
+    @Override
     public Name getName() {
         return NAME;
     }
 
     /**
-     * Returns <code>true</code> as this is the root path.
+     * Returns {@code true} as this is the root path.
      *
-     * @return <code>true</code>
+     * @return {@code true}
      */
     @Override
     public boolean denotesRoot() {
@@ -52,37 +53,41 @@ final class RootPath extends AbstractPat
     }
 
     /**
-     * Returns <code>false</code> as this is the root path.
+     * Returns {@code false} as this is the root path.
      *
-     * @return <code>false</code>
+     * @return {@code false}
      */
+    @Override
     public boolean isIdentifierBased() {
         return false;
     }
 
     /**
-     * Returns <code>true</code> as this is the root path.
+     * Returns {@code true} as this is the root path.
      *
-     * @return <code>true</code>
+     * @return {@code true}
      */
+    @Override
     public boolean isAbsolute() {
         return true;
     }
 
     /**
-     * Returns <code>true</code> as this is the root path.
+     * Returns {@code true} as this is the root path.
      *
-     * @return <code>true</code>
+     * @return {@code true}
      */
+    @Override
     public boolean isCanonical() {
         return true;
     }
 
     /**
-     * Returns <code>true</code> as this is the root path.
+     * Returns {@code true} as this is the root path.
      *
-     * @return <code>true</code>
+     * @return {@code true}
      */
+    @Override
     public boolean isNormalized() {
         return true;
     }
@@ -92,6 +97,7 @@ final class RootPath extends AbstractPat
      *
      * @return root path
      */
+    @Override
     public Path getNormalizedPath() {
         return this;
     }
@@ -101,18 +107,20 @@ final class RootPath extends AbstractPat
      *
      * @return root path
      */
+    @Override
     public Path getCanonicalPath() {
         return this;
     }
 
+    @Override
     public Path getAncestor(int degree)
             throws IllegalArgumentException, PathNotFoundException {
         if (degree < 0) {
             throw new IllegalArgumentException(
-                    "/.getAncestor(" + degree + ")");
+                    "/.getAncestor(" + degree + ')');
         } else if (degree > 0) {
             throw new PathNotFoundException(
-                    "/.getAncestor(" + degree + ")");
+                    "/.getAncestor(" + degree + ')');
         } else {
             return this;
         }
@@ -123,6 +131,7 @@ final class RootPath extends AbstractPat
      *
      * @return zero
      */
+    @Override
     public int getAncestorCount() {
         return 0;
     }
@@ -132,6 +141,7 @@ final class RootPath extends AbstractPat
      *
      * @return one
      */
+    @Override
     public int getLength() {
         return 1;
     }
@@ -141,27 +151,32 @@ final class RootPath extends AbstractPat
      *
      * @return zero
      */
+    @Override
     public int getDepth() {
         return 0;
     }
 
+    @Override
     public Path subPath(int from, int to) throws IllegalArgumentException {
         if (from == 0 && to == 1) {
             return this;
         } else {
             throw new IllegalArgumentException(
-                    "/.subPath(" + from + ", " + to + ")");
+                    "/.subPath(" + from + ", " + to + ')');
         }
     }
 
+    @Override
     public Element[] getElements() {
         return new Element[] { ROOT_PATH };
     }
 
+    @Override
     public Element getNameElement() {
         return ROOT_PATH;
     }
 
+    @Override
     public String getString() {
         return "{}";
     }
@@ -169,7 +184,7 @@ final class RootPath extends AbstractPat
     //--------------------------------------------------------< Serializable >
 
     /** Returns the singleton instance of this class */
-    public Object readResolve() {
+    public static Object readResolve() {
         return ROOT_PATH;
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceAdder.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceAdder.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceAdder.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceAdder.java Wed Sep  7 12:00:14 2011
@@ -17,11 +17,9 @@
 package org.apache.jackrabbit.spi.commons.namespace;
 
 import javax.jcr.NamespaceRegistry;
-import javax.jcr.NamespaceException;
-import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.RepositoryException;
 import java.util.Map;
-import java.util.Iterator;
+import java.util.Map.Entry;
 
 public class NamespaceAdder {
 
@@ -31,19 +29,17 @@ public class NamespaceAdder {
         registry = nsr;
     }
 
-    public void addNamespaces(NamespaceMapping nsm)
-            throws NamespaceException, UnsupportedRepositoryOperationException, RepositoryException {
+    public void addNamespaces(NamespaceMapping nsm) throws RepositoryException {
         Map m = nsm.getPrefixToURIMapping();
-        for (Iterator i = m.entrySet().iterator(); i.hasNext();) {
-            Map.Entry e = (Map.Entry) i.next();
+        for (Object o : m.entrySet()) {
+            Entry e = (Entry) o;
             String prefix = (String) e.getKey();
             String uri = (String) e.getValue();
             registry.registerNamespace(prefix, uri);
         }
     }
 
-    public void addNamespace(String prefix, String uri)
-        throws NamespaceException, UnsupportedRepositoryOperationException, RepositoryException {
+    public void addNamespace(String prefix, String uri) throws RepositoryException {
         registry.registerNamespace(prefix, uri);
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceExtractor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceExtractor.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceExtractor.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceExtractor.java Wed Sep  7 12:00:14 2011
@@ -42,10 +42,11 @@ import java.io.FileInputStream;
  * to resolve namespaces.
  */
 public class NamespaceExtractor {
-    private static Logger log = LoggerFactory.getLogger(NamespaceExtractor.class);
+    private static final Logger log = LoggerFactory.getLogger(NamespaceExtractor.class);
+
     private final NamespaceMapping mapping = new NamespaceMapping();
     private final Map basePrefixes = new HashMap();
-    private String defaultBasePrefix;
+    private final String defaultBasePrefix;
 
     /**
      * Constructor
@@ -77,11 +78,15 @@ public class NamespaceExtractor {
      * SAX ContentHandler that reacts to namespace mappings in incoming XML.
      */
     private class NamespaceHandler extends DefaultHandler {
+
+        @Override
         public void startPrefixMapping(String prefix, String uri) throws SAXException {
-            if (uri == null) uri = "";
+            if (uri == null) {
+                uri = "";
+            }
 
             //Replace the empty prefix with the defaultBasePrefix
-            if (prefix == null || prefix.equals("")){
+            if (prefix == null || prefix.isEmpty()){
                 prefix = defaultBasePrefix;
             }
 
@@ -91,13 +96,13 @@ public class NamespaceExtractor {
                     int c;
                     Integer co = (Integer) basePrefixes.get(prefix);
                     if (co == null) {
-                        basePrefixes.put(prefix, new Integer(1));
+                        basePrefixes.put(prefix, 1);
                         c = 1;
                     } else {
-                        c = co.intValue() + 1;
-                        basePrefixes.put(prefix, new Integer(c));
+                        c = co + 1;
+                        basePrefixes.put(prefix, c);
                     }
-                    prefix = prefix + "_" + c;
+                    prefix = prefix + '_' + c;
                 }
                 mapping.setMapping(prefix, uri);
             } catch(NamespaceException e){

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java Wed Sep  7 12:00:14 2011
@@ -16,11 +16,10 @@
  */
 package org.apache.jackrabbit.spi.commons.namespace;
 
+import javax.jcr.NamespaceException;
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.jcr.NamespaceException;
-
 /**
  * A Simple Namespace Mapping table. Mappings can be added
  * and then the object can be used as a NamespaceResolver. Additionally, it can
@@ -38,7 +37,7 @@ public class NamespaceMapping implements
     private final NamespaceResolver base;
 
     public NamespaceMapping() {
-        this.base = null;
+        base = null;
     }
 
     /**
@@ -51,9 +50,8 @@ public class NamespaceMapping implements
 
 
     //--------------------------------------------------< NamespaceResolver >---
-    /**
-     * {@inheritDoc}
-     */
+
+    @Override
     public String getPrefix(String uri) throws NamespaceException {
         if (URIToPrefix.containsKey(uri)) {
             return URIToPrefix.get(uri);
@@ -64,9 +62,7 @@ public class NamespaceMapping implements
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getURI(String prefix) throws NamespaceException {
         if (prefixToURI.containsKey(prefix)) {
             return prefixToURI.get(prefix);
@@ -78,10 +74,11 @@ public class NamespaceMapping implements
     }
 
     //-------------------------------------------------------------< public >---
+
     /**
      * Returns true if prefix is already mapped to some URI. Returns false otherwise.
      * @param prefix prefix to check
-     * @return <code>true</code> if prefix is mapped
+     * @return {@code true} if prefix is mapped
      */
     public boolean hasPrefix(String prefix) {
         return prefixToURI.containsKey(prefix);
@@ -117,7 +114,7 @@ public class NamespaceMapping implements
      * Clear the mapping for an URI
      *
      * @param uri  URI to clear the mapping for
-     * @return  The prefix the URI was mapped to or <code>null</code> if it was not mapped.
+     * @return The prefix the URI was mapped to or {@code null} if it was not mapped.
      */
     public String removeMapping(String uri) {
         String prefix = URIToPrefix.remove(uri);
@@ -147,9 +144,7 @@ public class NamespaceMapping implements
     }
 
     //-------------------------------------------------------------< Object >---
-    /**
-     * {@inheritDoc}
-     */
+
     @Override
     public boolean equals(Object obj) {
         if (this == obj) {
@@ -157,8 +152,8 @@ public class NamespaceMapping implements
         }
         if (obj instanceof NamespaceMapping) {
             NamespaceMapping other = (NamespaceMapping) obj;
-            return this.getPrefixToURIMapping().equals(other.getPrefixToURIMapping())
-                   && this.getURIToPrefixMapping().equals(other.getURIToPrefixMapping());
+            return getPrefixToURIMapping().equals(other.getPrefixToURIMapping())
+                   && getURIToPrefixMapping().equals(other.getURIToPrefixMapping());
         }
         return false;
     }
@@ -174,7 +169,7 @@ public class NamespaceMapping implements
         for (Map.Entry<String, String> entry: prefixToURI.entrySet()) {
             String prefix = entry.getKey();
             String uri = entry.getValue();
-            s += "'" + prefix + "' == '" + uri + "'\n";
+            s += '\'' + prefix + "' == '" + uri + "'\n";
         }
         return s;
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/RegistryNamespaceResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/RegistryNamespaceResolver.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/RegistryNamespaceResolver.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/RegistryNamespaceResolver.java Wed Sep  7 12:00:14 2011
@@ -40,6 +40,7 @@ public class RegistryNamespaceResolver i
         this.registry = registry;
     }
 
+    @Override
     public String getPrefix(String uri) throws NamespaceException {
         try {
             return registry.getPrefix(uri);
@@ -52,6 +53,7 @@ public class RegistryNamespaceResolver i
         }
     }
 
+    @Override
     public String getURI(String prefix) throws NamespaceException {
         try {
             return registry.getURI(prefix);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/SessionNamespaceResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/SessionNamespaceResolver.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/SessionNamespaceResolver.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/SessionNamespaceResolver.java Wed Sep  7 12:00:14 2011
@@ -21,13 +21,13 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 /**
- * helper class that exposes the <code>NamespaceResolver</code>
- * interface on a <code>Session</code>.
+ * helper class that exposes the {@code NamespaceResolver}
+ * interface on a {@code Session}.
  */
 public class SessionNamespaceResolver implements NamespaceResolver {
 
     /**
-     * the session for the namespace lookups
+     * the session for the namespace look ups
      */
     private final Session session;
 
@@ -39,9 +39,7 @@ public class SessionNamespaceResolver im
         this.session = session;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getPrefix(String uri) throws NamespaceException {
         try {
             return session.getNamespacePrefix(uri);
@@ -51,9 +49,7 @@ public class SessionNamespaceResolver im
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getURI(String prefix) throws NamespaceException {
         try {
             return session.getNamespaceURI(prefix);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractItemDefinitionTemplate.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractItemDefinitionTemplate.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractItemDefinitionTemplate.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractItemDefinitionTemplate.java Wed Sep  7 12:00:14 2011
@@ -30,9 +30,9 @@ import javax.jcr.NamespaceException;
 import javax.jcr.version.OnParentVersionAction;
 
 /**
- * <code>AbstractItemDefinitionTemplate</code> serves as base class for
- * <code>NodeDefinitionTemplateImpl</code> and
- * <code>PropertyDefinitionTemplateImpl</code>.
+ * {@code AbstractItemDefinitionTemplate} serves as base class for
+ * {@code NodeDefinitionTemplateImpl} and
+ * {@code PropertyDefinitionTemplateImpl}.
  */
 abstract class AbstractItemDefinitionTemplate implements ItemDefinition {
 
@@ -80,7 +80,7 @@ abstract class AbstractItemDefinitionTem
     /**
      * Sets the name of the child item.
      *
-     * @param name a <code>String</code>.
+     * @param name a {@code String}.
      * @throws ConstraintViolationException
      */
     public void setName(String name) throws ConstraintViolationException {
@@ -100,7 +100,7 @@ abstract class AbstractItemDefinitionTem
     /**
      * Sets the auto-create status of the child item.
      *
-     * @param autoCreated a <code>boolean</code>.
+     * @param autoCreated a {@code boolean}.
      */
     public void setAutoCreated(boolean autoCreated) {
         this.autoCreated = autoCreated;
@@ -109,7 +109,7 @@ abstract class AbstractItemDefinitionTem
     /**
      * Sets the mandatory status of the child item.
      *
-     * @param mandatory a <code>boolean</code>.
+     * @param mandatory a {@code boolean}.
      */
     public void setMandatory(boolean mandatory) {
         this.mandatory = mandatory;
@@ -118,8 +118,8 @@ abstract class AbstractItemDefinitionTem
     /**
      * Sets the on-parent-version status of the child item.
      *
-     * @param opv an <code>int</code> constant member of <code>OnParentVersionAction</code>.
-     * @throws IllegalArgumentException If the given <code>opv</code> flag isn't valid.
+     * @param opv an {@code int} constant member of {@code OnParentVersionAction}.
+     * @throws IllegalArgumentException If the given {@code opv} flag isn't valid.
      */
     public void setOnParentVersion(int opv) {
         // validate the given opv-action
@@ -130,16 +130,15 @@ abstract class AbstractItemDefinitionTem
     /**
      * Sets the protected status of the child item.
      *
-     * @param protectedStatus a <code>boolean</code>.
+     * @param protectedStatus a {@code boolean}.
      */
     public void setProtected(boolean protectedStatus) {
         this.protectedStatus = protectedStatus;
     }
 
     //-------------------------------------------------------< ItemDefinition >
-    /**
-     * {@inheritDoc}
-     */
+
+    @Override
     public String getName() {
         if (name == null) {
             return null;
@@ -154,37 +153,27 @@ abstract class AbstractItemDefinitionTem
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public NodeType getDeclaringNodeType() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isAutoCreated() {
         return autoCreated;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isMandatory() {
         return mandatory;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public int getOnParentVersion() {
         return opv;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isProtected() {
         return protectedStatus;
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractNodeType.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractNodeType.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractNodeType.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractNodeType.java Wed Sep  7 12:00:14 2011
@@ -37,10 +37,10 @@ import javax.jcr.NamespaceException;
 import java.util.ArrayList;
 
 /**
- * <code>AbstractNodeType</code>...
+ * {@code AbstractNodeType}...
  */
 /**
- * <code>AbstractNodeType</code>...
+ * {@code AbstractNodeType}...
  */
 public abstract class AbstractNodeType implements NodeType {
 
@@ -56,16 +56,14 @@ public abstract class AbstractNodeType i
     protected final NamePathResolver resolver;
 
     /**
-     * Create a new <code>AbstractNodeType</code>.
+     * Create a new {@code AbstractNodeType}.
      *
      * @param ntd      the underlying node type definition.
      * @param ntMgr    the node type manager.
      * @param resolver the name/path resolver of the session that created this
      *                 node type instance.
      */
-    public AbstractNodeType(QNodeTypeDefinition ntd,
-                            AbstractNodeTypeManager ntMgr,
-                            NamePathResolver resolver) {
+    public AbstractNodeType(QNodeTypeDefinition ntd, AbstractNodeTypeManager ntMgr, NamePathResolver resolver) {
         this.ntd = ntd;
         this.ntMgr = ntMgr;
         this.resolver = resolver;
@@ -82,9 +80,7 @@ public abstract class AbstractNodeType i
 
     //-----------------------------------------------------------< NodeType >---
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getName() {
         try {
             return resolver.getJCRName(ntd.getName());
@@ -95,30 +91,22 @@ public abstract class AbstractNodeType i
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isAbstract() {
         return ntd.isAbstract();
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isMixin() {
         return ntd.isMixin();
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isQueryable() {
         return ntd.isQueryable();
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String[] getDeclaredSupertypeNames() {
         Name[] ntNames = ntd.getSupertypes();
         String[] supertypes = new String[ntNames.length];
@@ -134,9 +122,7 @@ public abstract class AbstractNodeType i
         return supertypes;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public NodeType[] getDeclaredSupertypes() {
         Name[] ntNames = ntd.getSupertypes();
         NodeType[] supertypes = new NodeType[ntNames.length];
@@ -155,6 +141,7 @@ public abstract class AbstractNodeType i
     /**
      * @see javax.jcr.nodetype.NodeType#getDeclaredSubtypes()
      */
+    @Override
     public NodeTypeIterator getDeclaredSubtypes() {
         return getSubtypes(true);
     }
@@ -162,13 +149,12 @@ public abstract class AbstractNodeType i
     /**
      * @see javax.jcr.nodetype.NodeType#getSubtypes()
      */
+    @Override
     public NodeTypeIterator getSubtypes() {
         return getSubtypes(false);
     }        
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public NodeDefinition[] getDeclaredChildNodeDefinitions() {
         QNodeDefinition[] cnda = ntd.getChildNodeDefs();
         NodeDefinition[] nodeDefs = new NodeDefinition[cnda.length];
@@ -178,9 +164,7 @@ public abstract class AbstractNodeType i
         return nodeDefs;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getPrimaryItemName() {
         // TODO JCR-1947: JSR 283: Node Type Attribute Subtyping Rules
         try {
@@ -200,6 +184,7 @@ public abstract class AbstractNodeType i
     /**
      * @see javax.jcr.nodetype.NodeTypeDefinition#getDeclaredPropertyDefinitions()
      */
+    @Override
     public PropertyDefinition[] getDeclaredPropertyDefinitions() {
         QPropertyDefinition[] pda = ntd.getPropertyDefs();
         PropertyDefinition[] propDefs = new PropertyDefinition[pda.length];
@@ -209,9 +194,7 @@ public abstract class AbstractNodeType i
         return propDefs;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isNodeType(String nodeTypeName) {
         Name ntName;
         try {
@@ -228,14 +211,14 @@ public abstract class AbstractNodeType i
 
     /**
      * Test if this nodetype equals or is directly or indirectly derived from
-     * the node type with the specified <code>nodeTypeName</code>, without
+     * the node type with the specified {@code nodeTypeName}, without
      * checking of a node type of that name really exists.
      *
      * @param nodeTypeName A node type name.
      * @return true if this node type represents the type with the given
-     * <code>nodeTypeName</code> or if it is directly or indirectly derived
-     * from it; otherwise <code>false</code>. If no node type exists with the
-     * specified name this method will also return <code>false</code>.
+     * {@code nodeTypeName} or if it is directly or indirectly derived
+     * from it; otherwise {@code false}. If no node type exists with the
+     * specified name this method will also return {@code false}.
      */
     public abstract boolean isNodeType(Name nodeTypeName);
 
@@ -244,9 +227,9 @@ public abstract class AbstractNodeType i
     /**
      * Returns the node types derived from this node type.
      *
-     * @param directOnly if <code>true</code> only direct subtypes will be considered
+     * @param directOnly if {@code true} only direct subtypes will be considered
      *
-     * @return an <code>NodeTypeIterator</code>.
+     * @return an {@code NodeTypeIterator}.
      * @see NodeType#getSubtypes
      * @see NodeType#getDeclaredSubtypes
      */

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractNodeTypeManager.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractNodeTypeManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/AbstractNodeTypeManager.java Wed Sep  7 12:00:14 2011
@@ -21,36 +21,35 @@ import org.apache.jackrabbit.spi.QNodeDe
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 
-import javax.jcr.nodetype.NodeTypeManager;
-import javax.jcr.nodetype.NodeTypeTemplate;
-import javax.jcr.nodetype.NodeTypeDefinition;
-import javax.jcr.nodetype.NodeDefinitionTemplate;
-import javax.jcr.nodetype.PropertyDefinitionTemplate;
-import javax.jcr.nodetype.NodeType;
+import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import javax.jcr.nodetype.NodeDefinition;
+import javax.jcr.nodetype.NodeDefinitionTemplate;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeDefinition;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.nodetype.NodeTypeTemplate;
 import javax.jcr.nodetype.PropertyDefinition;
-import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.PropertyDefinitionTemplate;
 
 /**
- * <code>AbstractNodeTypeManager</code> covers creation of node type templates
+ * {@code AbstractNodeTypeManager} covers creation of node type templates
  * and definition templates.
  */
 public abstract class AbstractNodeTypeManager implements NodeTypeManager {
 
     /**
-     * Return the node type with the specified <code>ntName</code>.
+     * Return the node type with the specified {@code ntName}.
      *
      * @param ntName Name of the node type to be returned.
-     * @return the node type with the specified <code>ntName</code>.
+     * @return the node type with the specified {@code ntName}.
      * @throws NoSuchNodeTypeException If no such node type exists.
      */
     public abstract NodeType getNodeType(Name ntName) throws NoSuchNodeTypeException;
 
     /**
-     * Retrieve the <code>NodeDefinition</code> for the given
-     * <code>QNodeDefinition</code>.
+     * Retrieve the {@code NodeDefinition} for the given
+     * {@code QNodeDefinition}.
      *
      * @param nd the QNodeDefinition.
      * @return the node definition.
@@ -58,8 +57,8 @@ public abstract class AbstractNodeTypeMa
     public abstract NodeDefinition getNodeDefinition(QNodeDefinition nd);
 
     /**
-     * Retrieve the <code>PropertyDefinition</code> for the given
-     * <code>QPropertyDefinition</code>.
+     * Retrieve the {@code PropertyDefinition} for the given
+     * {@code QPropertyDefinition}.
      *
      * @param pd the QPropertyDefinition.
      * @return the property definition.
@@ -76,52 +75,53 @@ public abstract class AbstractNodeTypeMa
     public abstract NamePathResolver getNamePathResolver();
 
     //----------------------------------------------------< NodeTypeManager >---
+
     /**
      * @see javax.jcr.nodetype.NodeTypeManager#createNodeTypeTemplate()
      */
-    public NodeTypeTemplate createNodeTypeTemplate()
-            throws UnsupportedRepositoryOperationException, RepositoryException {
+    @Override
+    public NodeTypeTemplate createNodeTypeTemplate() throws RepositoryException {
         return new NodeTypeTemplateImpl(getNamePathResolver());
     }
 
     /**
      * @see javax.jcr.nodetype.NodeTypeManager#createNodeTypeTemplate(NodeTypeDefinition)
      */
-    public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd)
-            throws UnsupportedRepositoryOperationException, RepositoryException {
+    @Override
+    public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd) throws RepositoryException {
         return new NodeTypeTemplateImpl(ntd, getNamePathResolver());
     }
 
     /**
      * @see javax.jcr.nodetype.NodeTypeManager#createNodeDefinitionTemplate()
      */
-    public NodeDefinitionTemplate createNodeDefinitionTemplate()
-            throws UnsupportedRepositoryOperationException, RepositoryException {
+    @Override
+    public NodeDefinitionTemplate createNodeDefinitionTemplate() throws RepositoryException {
         return new NodeDefinitionTemplateImpl(getNamePathResolver());
     }
 
     /**
      * @see javax.jcr.nodetype.NodeTypeManager#createPropertyDefinitionTemplate()
      */
-    public PropertyDefinitionTemplate createPropertyDefinitionTemplate()
-            throws UnsupportedRepositoryOperationException, RepositoryException {
+    @Override
+    public PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws RepositoryException {
         return new PropertyDefinitionTemplateImpl(getNamePathResolver());
     }
 
     /**
      * @see javax.jcr.nodetype.NodeTypeManager#registerNodeType(NodeTypeDefinition, boolean)
      */
-    public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate)
-            throws RepositoryException {
-        NodeTypeDefinition[] ntds = new NodeTypeDefinition[] { ntd };
-        return registerNodeTypes(ntds, allowUpdate).nextNodeType();
+    @Override
+    public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws RepositoryException {
+        NodeTypeDefinition[] ntDefs = new NodeTypeDefinition[] { ntd };
+        return registerNodeTypes(ntDefs, allowUpdate).nextNodeType();
     }
 
     /**
      * @see javax.jcr.nodetype.NodeTypeManager#unregisterNodeType(String)
      */
-    public void unregisterNodeType(String name)
-            throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException {
+    @Override
+    public void unregisterNodeType(String name) throws RepositoryException {
         unregisterNodeTypes(new String[] {name});
     }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/InvalidConstraintException.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/InvalidConstraintException.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/InvalidConstraintException.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/InvalidConstraintException.java Wed Sep  7 12:00:14 2011
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.spi.common
 import javax.jcr.RepositoryException;
 
 /**
- * The <code>InvalidConstraintException</code> ...
+ * The {@code InvalidConstraintException} ...
  */
 public class InvalidConstraintException extends RepositoryException {
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/ItemDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/ItemDefinitionImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/ItemDefinitionImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/ItemDefinitionImpl.java Wed Sep  7 12:00:14 2011
@@ -27,9 +27,9 @@ import javax.jcr.nodetype.NoSuchNodeType
 import javax.jcr.NamespaceException;
 
 /**
- * This class implements the <code>ItemDefinition</code> interface.
+ * This class implements the {@code ItemDefinition} interface.
  * All method calls are delegated to the wrapped {@link org.apache.jackrabbit.spi.QItemDefinition},
- * performing the translation from <code>Name</code>s to JCR names
+ * performing the translation from {@code Name}s to JCR names
  * (and vice versa) where necessary.
  */
 abstract class ItemDefinitionImpl implements ItemDefinition {
@@ -37,7 +37,7 @@ abstract class ItemDefinitionImpl implem
     /**
      * Logger instance for this class
      */
-    private static Logger log = LoggerFactory.getLogger(ItemDefinitionImpl.class);
+    private static final Logger log = LoggerFactory.getLogger(ItemDefinitionImpl.class);
 
     /**
      * Literal for 'any name'.
@@ -45,7 +45,7 @@ abstract class ItemDefinitionImpl implem
     protected static final String ANY_NAME = "*";
 
     /**
-     * The namespace resolver used to translate <code>Name</code>s to JCR name strings.
+     * The namespace resolver used to translate {@code Name}s to JCR name strings.
      */
     protected final NamePathResolver resolver;
 
@@ -85,9 +85,8 @@ abstract class ItemDefinitionImpl implem
     }
 
     //-----------------------------------------------------< ItemDefinition >---
-    /**
-     * {@inheritDoc}
-     */
+
+    @Override
     public NodeType getDeclaringNodeType() {
         if (ntMgr == null) {
             // only a template
@@ -103,9 +102,7 @@ abstract class ItemDefinitionImpl implem
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getName() {
         if (itemDef.definesResidual()) {
             return ANY_NAME;
@@ -121,38 +118,28 @@ abstract class ItemDefinitionImpl implem
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public int getOnParentVersion() {
         return itemDef.getOnParentVersion();
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isAutoCreated() {
         return itemDef.isAutoCreated();
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isMandatory() {
         return itemDef.isMandatory();
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean isProtected() {
         return itemDef.isProtected();
     }
 
     //-------------------------------------------------------------< Object >---
-    /**
-     * {@inheritDoc}
-     */
+
     @Override
     public boolean equals(Object o) {
         if (this == o) {
@@ -164,9 +151,6 @@ abstract class ItemDefinitionImpl implem
         return itemDef.equals(((ItemDefinitionImpl) o).itemDef);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public int hashCode() {
         return itemDef.hashCode();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionImpl.java Wed Sep  7 12:00:14 2011
@@ -30,9 +30,9 @@ import javax.jcr.nodetype.NoSuchNodeType
 import javax.jcr.NamespaceException;
 
 /**
- * This class implements the <code>NodeDefinition</code> interface.
+ * This class implements the {@code NodeDefinition} interface.
  * All method calls are delegated to the wrapped {@link QNodeDefinition},
- * performing the translation from <code>Name</code>s to JCR names
+ * performing the translation from {@code Name}s to JCR names
  * where necessary.
  */
 public class NodeDefinitionImpl extends ItemDefinitionImpl implements NodeDefinition {
@@ -74,9 +74,7 @@ public class NodeDefinitionImpl extends 
 
     //-------------------------------------------------------< NodeDefinition >
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public boolean allowsSameNameSiblings() {
         return ((QNodeDefinition) itemDef).allowsSameNameSiblings();
     }
@@ -85,6 +83,7 @@ public class NodeDefinitionImpl extends 
      * @see NodeDefinition#getDefaultPrimaryTypeName()
      * @since JCR 2.0
      */
+    @Override
     public String getDefaultPrimaryTypeName() {
         Name ntName = ((QNodeDefinition) itemDef).getDefaultPrimaryType();
         if (ntName == null) {
@@ -99,9 +98,7 @@ public class NodeDefinitionImpl extends 
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public NodeType getDefaultPrimaryType() {
         if (ntMgr == null) {
             // not attached to an existing node type
@@ -120,9 +117,7 @@ public class NodeDefinitionImpl extends 
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public NodeType[] getRequiredPrimaryTypes() {
         if (ntMgr == null) {
             // not attached to an existing node type
@@ -151,6 +146,7 @@ public class NodeDefinitionImpl extends 
      * @see NodeDefinition#getRequiredPrimaryTypeNames()
      * @since JCR 2.0
      */
+    @Override
     public String[] getRequiredPrimaryTypeNames() {
         Name[] ntNames = ((QNodeDefinition) itemDef).getRequiredPrimaryTypes();
         try {



Mime
View raw message