You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by md...@apache.org on 2011/09/08 13:50:45 UTC

svn commit: r1166638 [1/3] - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/ jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/ jackrabbit-jcr-commons/src/main/java/org/apac...

Author: mduerig
Date: Thu Sep  8 11:50:44 2011
New Revision: 1166638

URL: http://svn.apache.org/viewvc?rev=1166638&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
clean up

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractRepository.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefReader.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefWriter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/DefinitionBuilderFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/ParseException.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventListenerIteratorAdapter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/FrozenNodeIteratorAdapter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeIteratorAdapter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeTypeIteratorAdapter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/VersionIteratorAdapter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilder.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilderRegistry.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/qom/JoinType.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/qom/Operator.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/qom/Order.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/xml/SerializingContentHandler.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Base64.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ChildrenCollectorFilter.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ISO8601.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/ISO9075.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Text.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/TransientFileFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/WeakIdentityCollection.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/XMLChar.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BinaryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DateValue.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ValueFactoryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ValueHelper.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathMap.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/Pattern.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java Thu Sep  8 11:50:44 2011
@@ -16,10 +16,6 @@
  */
 package org.apache.jackrabbit.commons;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Calendar;
-
 import javax.jcr.Item;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.ItemVisitor;
@@ -28,9 +24,11 @@ import javax.jcr.PathNotFoundException;
 import javax.jcr.Property;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
-import javax.jcr.Session;
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Calendar;
 
 /**
  * Abstract base class for implementing the JCR {@link Property} interface.
@@ -61,8 +59,7 @@ import javax.jcr.ValueFormatException;
  * is accessible. In such cases the default method implementations in this
  * class <em>will not work</em>.
  */
-public abstract class AbstractProperty extends AbstractItem
-        implements Item, Property {
+public abstract class AbstractProperty extends AbstractItem implements Property {
 
     //----------------------------------------------------------------< Item >
 
@@ -75,6 +72,7 @@ public abstract class AbstractProperty e
      * @param visitor item visitor
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void accept(ItemVisitor visitor) throws RepositoryException {
         visitor.visit(this);
     }
@@ -88,8 +86,9 @@ public abstract class AbstractProperty e
      * @return property path
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public String getPath() throws RepositoryException {
-        StringBuffer buffer = new StringBuffer(getParent().getPath());
+        StringBuilder buffer = new StringBuilder(getParent().getPath());
         if (buffer.length() > 1) {
             buffer.append('/');
         }
@@ -98,10 +97,11 @@ public abstract class AbstractProperty e
     }
 
     /**
-     * Returns <code>false</code>.
+     * Returns {@code false}.
      *
-     * @return <code>false</code>
+     * @return {@code false}
      */
+    @Override
     public boolean isNode() {
         return false;
     }
@@ -110,10 +110,11 @@ public abstract class AbstractProperty e
      * Removes this property.
      * <p>
      * The default implementation calls {@link Node#setProperty(String, Value)}
-     * with a <code>null</code> value on the parent node.
+     * with a {@code null} value on the parent node.
      *
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void remove() throws RepositoryException {
         getParent().setProperty(getName(), (Value) null);
     }
@@ -130,6 +131,7 @@ public abstract class AbstractProperty e
      * @return boolean value
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public boolean getBoolean() throws RepositoryException {
         return getValue().getBoolean();
     }
@@ -144,6 +146,7 @@ public abstract class AbstractProperty e
      * @return date value
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public Calendar getDate() throws RepositoryException {
         return getValue().getDate();
     }
@@ -158,6 +161,7 @@ public abstract class AbstractProperty e
      * @return double value
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public double getDouble() throws RepositoryException {
         return getValue().getDouble();
     }
@@ -171,6 +175,7 @@ public abstract class AbstractProperty e
      * @return length of the property value
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public long getLength() throws RepositoryException {
         return getLength(getValue());
     }
@@ -184,6 +189,7 @@ public abstract class AbstractProperty e
      * @return lengths of the property values
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public long[] getLengths() throws RepositoryException {
         Value[] values = getValues();
         long[] lengths = new long[values.length];
@@ -203,38 +209,40 @@ public abstract class AbstractProperty e
      * @return long value
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public long getLong() throws RepositoryException {
         return getValue().getLong();
     }
 
     /**
-      * If this property is of type <code>REFERENCE</code>,
-      * <code>WEAKREFERENCE</code> or <code>PATH</code> (or convertible to one of
-      * these types) this method returns the <code>Node</code> to which this
-      * property refers.
-      * <p>
-      * If this property is of type <code>PATH</code> and it contains a relative
-      * path, it is interpreted relative to the parent node of this property. For
-      * example "<code>.</code>" refers to the parent node itself,
-      * "<code>..</code>" to the parent of the parent node and "<code>foo</code>"
-      * to a sibling node of this property.
-      *
-      * @return the referenced Node
-      * @throws ValueFormatException  if this property cannot be converted to a
-      *                               referring type (<code>REFERENCE</code>, <code>WEAKREFERENCE</code> or
-      *                               <code>PATH</code>), if the property is multi-valued or if this property
-      *                               is a referring type but is currently part of the frozen state of a
-      *                               version in version storage.
-      * @throws ItemNotFoundException If this property is of type
-      *                               <code>PATH</code> or <code>WEAKREFERENCE</code> and no target node
-      *                               accessible by the current <code>Session</code> exists in this workspace.
-      *                               Note that this applies even if the property is a <code>PATHS</code> and a
-      *                               <i>property</i> exists at the specified location. To dereference to a
-      *                               target property (as opposed to a target node), the method
-      *                               <code>Property.getProperty</code> is used.
-      * @throws RepositoryException   if another error occurs.
-      */
-    public Node getNode() throws ValueFormatException, RepositoryException {
+     * If this property is of type {@code REFERENCE},
+     * {@code WEAKREFERENCE} or {@code PATH} (or convertible to one of
+     * these types) this method returns the {@code Node} to which this
+     * property refers.
+     * <p>
+     * If this property is of type {@code PATH} and it contains a relative
+     * path, it is interpreted relative to the parent node of this property. For
+     * example "{@code .}" refers to the parent node itself,
+     * "{@code ..}" to the parent of the parent node and "{@code foo}"
+     * to a sibling node of this property.
+     *
+     * @return the referenced Node
+     * @throws ValueFormatException  if this property cannot be converted to a
+     *                               referring type ({@code REFERENCE}, {@code WEAKREFERENCE} or
+     *                               {@code PATH}), if the property is multi-valued or if this property
+     *                               is a referring type but is currently part of the frozen state of a
+     *                               version in version storage.
+     * @throws ItemNotFoundException If this property is of type
+     *                               {@code PATH} or {@code WEAKREFERENCE} and no target node
+     *                               accessible by the current {@code Session} exists in this workspace.
+     *                               Note that this applies even if the property is a {@code PATHS} and a
+     *                               <i>property</i> exists at the specified location. To dereference to a
+     *                               target property (as opposed to a target node), the method
+     *                               {@code Property.getProperty} is used.
+     * @throws RepositoryException   if another error occurs.
+     */
+    @Override
+    public Node getNode() throws RepositoryException {
         String value = getString();
 
         switch (getType()) {
@@ -244,7 +252,7 @@ public abstract class AbstractProperty e
 
             case PropertyType.PATH:
                 try {
-                    return (value.startsWith("/")) ? getSession().getNode(value) : getParent().getNode(value);
+                    return value.startsWith("/") ? getSession().getNode(value) : getParent().getNode(value);
                 } catch (PathNotFoundException e) {
                     throw new ItemNotFoundException(value);
                 }
@@ -267,7 +275,7 @@ public abstract class AbstractProperty e
                     // try if STRING value can be interpreted as PATH value
                     Value pathValue = getSession().getValueFactory().createValue(value, PropertyType.PATH);
                     try {
-                        return (value.startsWith("/")) ? getSession().getNode(pathValue.getString()) : getParent().getNode(pathValue.getString());
+                        return value.startsWith("/") ? getSession().getNode(pathValue.getString()) : getParent().getNode(pathValue.getString());
                     } catch (PathNotFoundException e1) {
                         throw new ItemNotFoundException(pathValue.getString());
                     }
@@ -279,48 +287,49 @@ public abstract class AbstractProperty e
     }
 
     /**
-     * If this property is of type <code>PATH</code> (or convertible to this
-     * type) this method returns the <code>Property</code> to which <i>this</i>
+     * If this property is of type {@code PATH} (or convertible to this
+     * type) this method returns the {@code Property} to which <i>this</i>
      * property refers.
      * <p>
      * If this property contains a relative path, it is interpreted relative to
      * the parent node of this property. Therefore, when resolving such a
-     * relative path, the segment "<code>.</code>" refers to
-     * the parent node itself, "<code>..</code>" to the parent of the parent
-     * node and "<code>foo</code>" to a sibling property of this property or
+     * relative path, the segment "{@code .}" refers to
+     * the parent node itself, "{@code ..}" to the parent of the parent
+     * node and "{@code foo}" to a sibling property of this property or
      * this property itself.
      * <p>
      * For example, if this property is located at
-     * <code>/a/b/c</code> and it has a value of "<code>../d</code>" then this
-     * method will return the property at <code>/a/d</code> if such exists.
+     * {@code /a/b/c} and it has a value of "{@code ../d}" then this
+     * method will return the property at {@code /a/d} if such exists.
      * <p>
      * If this property is multi-valued, this method throws a
-     * <code>ValueFormatException</code>.
+     * {@code ValueFormatException}.
      * <p>
-     * If this property cannot be converted to a <code>PATH</code> then a
-     * <code>ValueFormatException</code> is thrown.
+     * If this property cannot be converted to a {@code PATH} then a
+     * {@code ValueFormatException} is thrown.
      * <p>
      * If this property is currently part of the frozen state of a version in
-     * version storage, this method will throw a <code>ValueFormatException</code>.
+     * version storage, this method will throw a {@code ValueFormatException}.
      *
      * @return the referenced property
      * @throws ValueFormatException  if this property cannot be converted to a
-     *                               <code>PATH</code>, if the property is multi-valued or if this property is
+     *                               {@code PATH}, if the property is multi-valued or if this property is
      *                               a referring type but is currently part of the frozen state of a version
      *                               in version storage.
      * @throws ItemNotFoundException If no property accessible by the current
-     *                               <code>Session</code> exists in this workspace at the specified path. Note
+     *                               {@code Session} exists in this workspace at the specified path. Note
      *                               that this applies even if a <i>node</i> exists at the specified location.
-     *                               To dereference to a target node, the method <code>Property.getNode</code>
+     *                               To dereference to a target node, the method {@code Property.getNode}
      *                               is used.
      * @throws RepositoryException   if another error occurs.
      */
+    @Override
     public Property getProperty() throws RepositoryException {
         String value = getString();
         switch (getType()) {
             case PropertyType.PATH:
                 try {
-                    return (value.startsWith("/")) ? getSession().getProperty(value) : getParent().getProperty(value);
+                    return value.startsWith("/") ? getSession().getProperty(value) : getParent().getProperty(value);
                 } catch (PathNotFoundException e) {
                     throw new ItemNotFoundException(value);
                 }
@@ -335,7 +344,7 @@ public abstract class AbstractProperty e
             default:
                 try {
                     String path = getSession().getValueFactory().createValue(value, PropertyType.PATH).getString();
-                    return (path.startsWith("/")) ? getSession().getProperty(path) : getParent().getProperty(path);
+                    return path.startsWith("/") ? getSession().getProperty(path) : getParent().getProperty(path);
                 } catch (PathNotFoundException e) {
                     throw new ItemNotFoundException(value);
                 }
@@ -352,6 +361,7 @@ public abstract class AbstractProperty e
      * @return binary value
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public InputStream getStream() throws RepositoryException {
         return getValue().getStream();
     }
@@ -366,6 +376,7 @@ public abstract class AbstractProperty e
      * @return string value
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public String getString() throws RepositoryException {
         return getValue().getString();
     }
@@ -380,6 +391,7 @@ public abstract class AbstractProperty e
      * @return property type
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public int getType() throws RepositoryException {
         return getValue().getType();
     }
@@ -394,6 +406,7 @@ public abstract class AbstractProperty e
      * @param value passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(Value value) throws RepositoryException {
         getParent().setProperty(getName(), value);
     }
@@ -408,6 +421,7 @@ public abstract class AbstractProperty e
      * @param values passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(Value[] values) throws RepositoryException {
         getParent().setProperty(getName(), values);
     }
@@ -422,6 +436,7 @@ public abstract class AbstractProperty e
      * @param value passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(String value) throws RepositoryException {
         getParent().setProperty(getName(), value);
     }
@@ -436,6 +451,7 @@ public abstract class AbstractProperty e
      * @param values passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(String[] values) throws RepositoryException {
         getParent().setProperty(getName(), values);
     }
@@ -450,6 +466,7 @@ public abstract class AbstractProperty e
      * @param value passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(InputStream value) throws RepositoryException {
         getParent().setProperty(getName(), value);
     }
@@ -464,6 +481,7 @@ public abstract class AbstractProperty e
      * @param value passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(long value) throws RepositoryException {
         getParent().setProperty(getName(), value);
     }
@@ -478,6 +496,7 @@ public abstract class AbstractProperty e
      * @param value passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(double value) throws RepositoryException {
         getParent().setProperty(getName(), value);
     }
@@ -492,6 +511,7 @@ public abstract class AbstractProperty e
      * @param value passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(Calendar value) throws RepositoryException {
         getParent().setProperty(getName(), value);
     }
@@ -506,6 +526,7 @@ public abstract class AbstractProperty e
      * @param value passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(boolean value) throws RepositoryException {
         getParent().setProperty(getName(), value);
     }
@@ -520,6 +541,7 @@ public abstract class AbstractProperty e
      * @param value passed through
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public void setValue(Node value) throws RepositoryException {
         getParent().setProperty(getName(), value);
     }
@@ -533,7 +555,7 @@ public abstract class AbstractProperty e
      * @return length of the value
      * @throws RepositoryException if an error occurs
      */
-    private long getLength(Value value) throws RepositoryException {
+    private static long getLength(Value value) throws RepositoryException {
         if (value.getType() != PropertyType.BINARY) {
             return value.getString().length();
         } else {
@@ -552,8 +574,7 @@ public abstract class AbstractProperty e
                     stream.close();
                 }
             } catch (IOException e) {
-                throw new RepositoryException(
-                        "Failed to count the length of a binary value", e);
+                throw new RepositoryException("Failed to count the length of a binary value", e);
             }
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractRepository.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractRepository.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractRepository.java Thu Sep  8 11:50:44 2011
@@ -16,19 +16,18 @@
  */
 package org.apache.jackrabbit.commons;
 
-import java.util.HashSet;
-import java.util.Set;
-
 import javax.jcr.Credentials;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * Abstract base class for implementing the JCR {@link Repository} interface.
  * <p>
  * This class implements the three utility login methods by calling the
- * {@link Repository#login(Credentials, String)} method with <code>null</code>
+ * {@link Repository#login(Credentials, String)} method with {@code null}
  * arguments as specified in the JCR API.
  */
 public abstract class AbstractRepository implements Repository {
@@ -93,44 +92,48 @@ public abstract class AbstractRepository
      * Returns true if the given key identifies a standard descriptor.
      *
      * @param key descriptor key
-     * @return <code>true</code> if the key identifies a standard descriptor,
-     *         <code>false</code> otherwise
+     * @return {@code true} if the key identifies a standard descriptor,
+     *         {@code false} otherwise
      */
+    @Override
     public boolean isStandardDescriptor(String key) {
         return STANDARD_KEYS.contains(key);
     }
 
     /**
      * Calls {@link Repository#login(Credentials, String)} with
-     * <code>null</code> arguments.
+     * {@code null} arguments.
      *
      * @return logged in session
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public Session login() throws RepositoryException {
         return login(null, null);
     }
 
     /**
      * Calls {@link Repository#login(Credentials, String)} with
-     * the given credentials and a <code>null</code> workspace name.
+     * the given credentials and a {@code null} workspace name.
      *
      * @param credentials login credentials
      * @return logged in session
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public Session login(Credentials credentials) throws RepositoryException {
         return login(credentials, null);
     }
 
     /**
      * Calls {@link Repository#login(Credentials, String)} with
-     * <code>null</code> credentials and the given workspace name.
+     * {@code null} credentials and the given workspace name.
      *
      * @param workspace workspace name
      * @return logged in session
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public Session login(String workspace) throws RepositoryException {
         return login(null, workspace);
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java Thu Sep  8 11:50:44 2011
@@ -16,13 +16,14 @@
  */
 package org.apache.jackrabbit.commons;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+import org.apache.jackrabbit.commons.xml.DocumentViewExporter;
+import org.apache.jackrabbit.commons.xml.Exporter;
+import org.apache.jackrabbit.commons.xml.ParsingContentHandler;
+import org.apache.jackrabbit.commons.xml.SystemViewExporter;
+import org.apache.jackrabbit.commons.xml.ToXmlContentHandler;
+import org.apache.jackrabbit.util.XMLChar;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
 
 import javax.jcr.Credentials;
 import javax.jcr.InvalidSerializedDataException;
@@ -35,15 +36,13 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Workspace;
-
-import org.apache.jackrabbit.commons.xml.DocumentViewExporter;
-import org.apache.jackrabbit.commons.xml.Exporter;
-import org.apache.jackrabbit.commons.xml.ParsingContentHandler;
-import org.apache.jackrabbit.commons.xml.SystemViewExporter;
-import org.apache.jackrabbit.commons.xml.ToXmlContentHandler;
-import org.apache.jackrabbit.util.XMLChar;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * Abstract base class for implementing the JCR {@link Session} interface.
@@ -62,9 +61,10 @@ public abstract class AbstractSession im
     /**
      * Clears the local namespace mappings. Subclasses that for example
      * want to participate in a session pools should remember to call
-     * <code>super.logout()</code> when overriding this method to avoid
+     * {@code super.logout()} when overriding this method to avoid
      * namespace mappings to be carried over to a new session.
      */
+    @Override
     public void logout() {
         synchronized (namespaces) {
             namespaces.clear();
@@ -86,8 +86,8 @@ public abstract class AbstractSession im
      * @throws NamespaceException if the namespace is not found
      * @throws RepositoryException if a repository error occurs
      */
-    public String getNamespacePrefix(String uri)
-            throws NamespaceException, RepositoryException {
+    @Override
+    public String getNamespacePrefix(String uri) throws RepositoryException {
         synchronized (namespaces) {
             for (Map.Entry<String, String> entry : namespaces.entrySet()) {
                 if (entry.getValue().equals(uri)) {
@@ -122,8 +122,8 @@ public abstract class AbstractSession im
      * @throws NamespaceException if the namespace is not found
      * @throws RepositoryException if a repository error occurs
      */
-    public String getNamespaceURI(String prefix)
-            throws NamespaceException, RepositoryException {
+    @Override
+    public String getNamespaceURI(String prefix) throws RepositoryException {
         synchronized (namespaces) {
             String uri = namespaces.get(prefix);
 
@@ -155,8 +155,8 @@ public abstract class AbstractSession im
      * @return namespace prefixes
      * @throws RepositoryException if a repository error occurs
      */
-    public String[] getNamespacePrefixes()
-            throws RepositoryException {
+    @Override
+    public String[] getNamespacePrefixes() throws RepositoryException {
         for (String uri : getWorkspace().getNamespaceRegistry().getURIs()) {
             getNamespacePrefix(uri);
         }
@@ -178,24 +178,20 @@ public abstract class AbstractSession im
      * @throws NamespaceException if the mapping is illegal
      * @throws RepositoryException if a repository error occurs
      */
-    public void setNamespacePrefix(String prefix, String uri)
-            throws NamespaceException, RepositoryException {
+    @Override
+    public void setNamespacePrefix(String prefix, String uri) throws RepositoryException {
         if (prefix == null) {
             throw new IllegalArgumentException("Prefix must not be null");
         } else if (uri == null) {
             throw new IllegalArgumentException("Namespace must not be null");
         } else if (prefix.length() == 0) {
-            throw new NamespaceException(
-                    "Empty prefix is reserved and can not be remapped");
+            throw new NamespaceException("Empty prefix is reserved and can not be remapped");
         } else if (uri.length() == 0) {
-            throw new NamespaceException(
-                    "Default namespace is reserved and can not be remapped");
+            throw new NamespaceException("Default namespace is reserved and can not be remapped");
         } else if (prefix.toLowerCase().startsWith("xml")) {
-            throw new NamespaceException(
-                    "XML prefixes are reserved: " + prefix);
+            throw new NamespaceException("XML prefixes are reserved: " + prefix);
         } else if (!XMLChar.isValidNCName(prefix)) {
-            throw new NamespaceException(
-                    "Prefix is not a valid XML NCName: " + prefix);
+            throw new NamespaceException("Prefix is not a valid XML NCName: " + prefix);
         }
 
         synchronized (namespaces) {
@@ -230,12 +226,11 @@ public abstract class AbstractSession im
      * @throws SAXException if the SAX event handler failed
      * @throws RepositoryException if another error occurs
      */
-    public void exportDocumentView(
-            String path, ContentHandler handler,
-            boolean skipBinary, boolean noRecurse)
-            throws PathNotFoundException, SAXException, RepositoryException {
-        export(path, new DocumentViewExporter(
-                this, handler, !noRecurse, !skipBinary));
+    @Override
+    public void exportDocumentView(String path, ContentHandler handler, boolean skipBinary, boolean noRecurse)
+            throws SAXException, RepositoryException {
+
+        export(path, new DocumentViewExporter(this, handler, !noRecurse, !skipBinary));
     }
 
     /**
@@ -250,12 +245,11 @@ public abstract class AbstractSession im
      * @throws SAXException if the SAX event handler failed
      * @throws RepositoryException if another error occurs
      */
-    public void exportSystemView(
-            String path, ContentHandler handler,
-            boolean skipBinary, boolean noRecurse)
-            throws PathNotFoundException, SAXException, RepositoryException {
-        export(path, new SystemViewExporter(
-                this, handler, !noRecurse, !skipBinary));
+    @Override
+    public void exportSystemView(String path, ContentHandler handler, boolean skipBinary, boolean noRecurse)
+            throws SAXException, RepositoryException {
+
+        export(path, new SystemViewExporter(this, handler, !noRecurse, !skipBinary));
     }
 
     /**
@@ -270,10 +264,10 @@ public abstract class AbstractSession im
      * @throws IOException if the SAX serialization failed
      * @throws RepositoryException if another error occurs
      */
-    public void exportDocumentView(
-            String absPath, OutputStream out,
-            boolean skipBinary, boolean noRecurse)
+    @Override
+    public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse)
             throws IOException, RepositoryException {
+
         try {
             ContentHandler handler = new ToXmlContentHandler(out);
             exportDocumentView(absPath, handler, skipBinary, noRecurse);
@@ -284,8 +278,7 @@ public abstract class AbstractSession im
             } else if (exception instanceof IOException) {
                 throw (IOException) exception;
             } else {
-                throw new RepositoryException(
-                        "Error serializing document view XML", e);
+                throw new RepositoryException("Error serializing document view XML", e);
             }
         }
     }
@@ -302,10 +295,10 @@ public abstract class AbstractSession im
      * @throws IOException if the SAX serialization failed
      * @throws RepositoryException if another error occurs
      */
-    public void exportSystemView(
-            String absPath, OutputStream out,
-            boolean skipBinary, boolean noRecurse)
+    @Override
+    public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse)
             throws IOException, RepositoryException {
+
         try {
             ContentHandler handler = new ToXmlContentHandler(out);
             exportSystemView(absPath, handler, skipBinary, noRecurse);
@@ -316,8 +309,7 @@ public abstract class AbstractSession im
             } else if (exception instanceof IOException) {
                 throw (IOException) exception;
             } else {
-                throw new RepositoryException(
-                        "Error serializing system view XML", e);
+                throw new RepositoryException("Error serializing system view XML", e);
             }
         }
     }
@@ -334,10 +326,10 @@ public abstract class AbstractSession im
      * @throws InvalidSerializedDataException if an XML parsing error occurs
      * @throws RepositoryException if a repository error occurs
      */
-    public void importXML(
-            String parentAbsPath, InputStream in, int uuidBehavior)
-            throws IOException, InvalidSerializedDataException,
-            RepositoryException {
+    @Override
+    public void importXML(String parentAbsPath, InputStream in, int uuidBehavior)
+            throws IOException, RepositoryException {
+
         try {
             ContentHandler handler =
                 getImportContentHandler(parentAbsPath, uuidBehavior);
@@ -361,7 +353,7 @@ public abstract class AbstractSession im
 
     //-----------------------------------------------------< Item handling >--
 
-    private String toRelativePath(String absPath) throws PathNotFoundException {
+    private static String toRelativePath(String absPath) throws PathNotFoundException {
         if (absPath.startsWith("/") && absPath.length() > 1) {
             return absPath.substring(1);
         } else {
@@ -389,8 +381,8 @@ public abstract class AbstractSession im
      * @throws PathNotFoundException if the given path is invalid or not found
      * @throws RepositoryException if another error occurs
      */
-    public Item getItem(String absPath)
-            throws PathNotFoundException, RepositoryException {
+    @Override
+    public Item getItem(String absPath) throws RepositoryException {
         Node root = getRootNode();
         if (absPath.equals("/")) {
             return root;
@@ -406,16 +398,17 @@ public abstract class AbstractSession im
 
     /**
      * Calls {@link #getItem(String)} with the given path and returns
-     * <code>true</code> if the call succeeds. Returns <code>false</code>
+     * {@code true} if the call succeeds. Returns {@code false}
      * if a {@link PathNotFoundException} was thrown. Other exceptions are
      * passed through.
      *
      * @see Session#itemExists(String)
      * @param absPath absolute path
-     * @return <code>true</code> if an item exists at the given path,
-     *         <code>false</code> otherwise
+     * @return {@code true} if an item exists at the given path,
+     *         {@code false} otherwise
      * @throws RepositoryException if an error occurs
      */
+    @Override
     public boolean itemExists(String absPath) throws RepositoryException {
         if (absPath.equals("/")) {
             return true;
@@ -434,6 +427,7 @@ public abstract class AbstractSession im
      * @param absPath An absolute path of the item to be removed
      * @throws RepositoryException if the item can not be removed
      */
+    @Override
     public void removeItem(String absPath) throws RepositoryException {
         getItem(absPath).remove();
     }
@@ -446,6 +440,7 @@ public abstract class AbstractSession im
      * @return node at the given path
      * @throws RepositoryException if the node can not be accessed
      */
+    @Override
     public Node getNode(String absPath) throws RepositoryException {
         Node root = getRootNode();
         if (absPath.equals("/")) {
@@ -460,16 +455,13 @@ public abstract class AbstractSession im
      *
      * @see Session#nodeExists(String)
      * @param absPath absolute path
-     * @return <code>true</code> if a node with the given path exists,
-     *         <code>false</code> otherwise
+     * @return {@code true} if a node with the given path exists,
+     *         {@code false} otherwise
      * @throws RepositoryException if the path is invalid
      */
+    @Override
     public boolean nodeExists(String absPath) throws RepositoryException {
-        if (absPath.equals("/")) {
-            return true;
-        } else {
-            return getRootNode().hasNode(toRelativePath(absPath));
-        }
+        return absPath.equals("/") || getRootNode().hasNode(toRelativePath(absPath));
     }
 
     /**
@@ -480,6 +472,7 @@ public abstract class AbstractSession im
      * @return node at the given path
      * @throws RepositoryException if the property can not be accessed
      */
+    @Override
     public Property getProperty(String absPath) throws RepositoryException {
         if (absPath.equals("/")) {
             throw new RepositoryException("The root node is not a property");
@@ -493,16 +486,13 @@ public abstract class AbstractSession im
      *
      * @see Session#propertyExists(String)
      * @param absPath absolute path
-     * @return <code>true</code> if a property with the given path exists,
-     *         <code>false</code> otherwise
+     * @return {@code true} if a property with the given path exists,
+     *         {@code false} otherwise
      * @throws RepositoryException if the path is invalid
      */
+    @Override
     public boolean propertyExists(String absPath) throws RepositoryException {
-        if (absPath.equals("/")) {
-            return false;
-        } else {
-            return getRootNode().hasProperty(toRelativePath(absPath));
-        }
+        return !absPath.equals("/") && getRootNode().hasProperty(toRelativePath(absPath));
     }
 
     //--------------------------------------------------< Session handling >--
@@ -526,8 +516,8 @@ public abstract class AbstractSession im
      * @return logged in session
      * @throws RepositoryException if an error occurs
      */
-    public Session impersonate(Credentials credentials)
-            throws RepositoryException {
+    @Override
+    public Session impersonate(Credentials credentials) throws RepositoryException {
         return getRepository().login(credentials, getWorkspace().getName());
     }
 
@@ -541,8 +531,7 @@ public abstract class AbstractSession im
      * @throws SAXException if the SAX event handler failed
      * @throws RepositoryException if another error occurs
      */
-    private synchronized void export(String path, Exporter exporter)
-            throws PathNotFoundException, SAXException, RepositoryException {
+    private synchronized void export(String path, Exporter exporter) throws SAXException, RepositoryException {
         Item item = getItem(path);
         if (item.isNode()) {
             exporter.export((Node) item);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefReader.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefReader.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefReader.java Thu Sep  8 11:50:44 2011
@@ -34,10 +34,10 @@ import java.util.List;
  * objects that can then be used to register node types.
  * <p/>
  * The CompactNodeTypeDefReader is parameterizable in the type of the node type
- * definition <code>T</code> and the type of the namespace mapping <code>N</code>
- * which the parser should build. For types <code>T</code> and <code>N</code> the
+ * definition {@code T} and the type of the namespace mapping {@code N}
+ * which the parser should build. For types {@code T} and {@code N} the
  * parser's constructor takes a {@link DefinitionBuilderFactory} for
- * <code>T</code> and <code>N</code>.
+ * {@code T} and {@code N}.
  * <p/>
  * <p/>
  * The EBNF grammar of the compact node type definition:<br>
@@ -133,8 +133,8 @@ public class CompactNodeTypeDefReader<T,
      * @param factory  builder for creating new definitions and handling namespaces
      * @throws ParseException if an error occurs
      */
-    public CompactNodeTypeDefReader(Reader r, String systemId,
-                                    DefinitionBuilderFactory<T, N> factory) throws ParseException {
+    public CompactNodeTypeDefReader(Reader r, String systemId, DefinitionBuilderFactory<T, N> factory)
+            throws ParseException {
 
         this(r, systemId, null, factory);
     }
@@ -148,10 +148,8 @@ public class CompactNodeTypeDefReader<T,
      * @param factory   builder for creating new definitions and handling namespaces
      * @throws ParseException if an error occurs
      */
-    public CompactNodeTypeDefReader(Reader r, String systemId, N nsMapping,
-                                    DefinitionBuilderFactory<T, N> factory) throws ParseException {
-
-        super();
+    public CompactNodeTypeDefReader(Reader r, String systemId, N nsMapping, DefinitionBuilderFactory<T, N> factory)
+            throws ParseException {
 
         this.factory = factory;
         lexer = new Lexer(r, systemId);
@@ -223,7 +221,7 @@ public class CompactNodeTypeDefReader<T,
     /**
      * processes the namespace declaration
      *
-     * @return <code>true</code> if a namespace was parsed
+     * @return {@code true} if a namespace was parsed
      * @throws ParseException if an error during parsing occurs
      */
     private boolean doNameSpace() throws ParseException {
@@ -282,17 +280,18 @@ public class CompactNodeTypeDefReader<T,
      * @throws ParseException if an error during parsing occurs
      */
     private void doSuperTypes(AbstractNodeTypeDefinitionBuilder<T> ntd) throws ParseException {
-
-        if (currentTokenEquals(Lexer.EXTENDS))
+        if (currentTokenEquals(Lexer.EXTENDS)) {
             do {
                 nextToken();
                 try {
                     ntd.addSupertype(currentToken);
-                } catch (RepositoryException e) {
+                }
+                catch (RepositoryException e) {
                     lexer.fail("Error setting super type of " + ntd.getName() + " to " + currentToken, e);
                 }
                 nextToken();
             } while (currentTokenEquals(Lexer.LIST_DELIMITER));
+        }
     }
 
     /**
@@ -302,7 +301,6 @@ public class CompactNodeTypeDefReader<T,
      * @throws ParseException if an error during parsing occurs
      */
     private void doOptions(AbstractNodeTypeDefinitionBuilder<T> ntd) throws ParseException {
-
         boolean hasOption = true;
         try {
             while (hasOption) {
@@ -418,7 +416,6 @@ public class CompactNodeTypeDefReader<T,
      * @throws ParseException if an error during parsing occurs
      */
     private void doPropertyType(AbstractPropertyDefinitionBuilder<T> pd) throws ParseException {
-
         if (!currentTokenEquals(Lexer.BEGIN_TYPE)) {
             return;
         }
@@ -470,8 +467,8 @@ public class CompactNodeTypeDefReader<T,
      * @param ntd declaring nodetype definition builder
      * @throws ParseException if an error during parsing occurs
      */
-    private void doPropertyAttributes(AbstractPropertyDefinitionBuilder<T> pd,
-                                      AbstractNodeTypeDefinitionBuilder<T> ntd) throws ParseException {
+    private void doPropertyAttributes(AbstractPropertyDefinitionBuilder<T> pd, AbstractNodeTypeDefinitionBuilder<T> ntd)
+            throws ParseException {
 
         try {
             while (currentTokenEquals(Lexer.PROP_ATTRIBUTE)) {
@@ -517,8 +514,7 @@ public class CompactNodeTypeDefReader<T,
      * @param pd the property definition builder
      * @throws ParseException if an error occurs
      */
-    private void doPropertyQueryOperators(AbstractPropertyDefinitionBuilder<T> pd)
-            throws ParseException {
+    private void doPropertyQueryOperators(AbstractPropertyDefinitionBuilder<T> pd) throws ParseException {
         if (!currentTokenEquals(Lexer.QUERYOPS)) {
             return;
         }
@@ -543,7 +539,7 @@ public class CompactNodeTypeDefReader<T,
             } else if (s.equals(Lexer.QUEROPS_LIKE)) {
                 queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_LIKE);
             } else {
-                lexer.fail("'" + s + "' is not a valid query operator");
+                lexer.fail('\'' + s + "' is not a valid query operator");
             }
         }
         try {
@@ -559,9 +555,7 @@ public class CompactNodeTypeDefReader<T,
      * @param pd property definition builder
      * @throws ParseException if an error during parsing occurs
      */
-    private void doPropertyDefaultValue(AbstractPropertyDefinitionBuilder<T> pd)
-            throws ParseException {
-
+    private void doPropertyDefaultValue(AbstractPropertyDefinitionBuilder<T> pd) throws ParseException {
         if (!currentTokenEquals(Lexer.DEFAULT)) {
             return;
         }
@@ -583,9 +577,7 @@ public class CompactNodeTypeDefReader<T,
      * @param pd property definition builder
      * @throws ParseException if an error during parsing occurs
      */
-    private void doPropertyValueConstraints(AbstractPropertyDefinitionBuilder<T> pd)
-            throws ParseException {
-
+    private void doPropertyValueConstraints(AbstractPropertyDefinitionBuilder<T> pd) throws ParseException {
         if (!currentTokenEquals(Lexer.CONSTRAINT)) {
             return;
         }
@@ -608,8 +600,7 @@ public class CompactNodeTypeDefReader<T,
      * @param ntd declaring nodetype definition builder
      * @throws ParseException if an error during parsing occurs
      */
-    private void doChildNodeDefinition(AbstractNodeDefinitionBuilder<T> nd,
-                                       AbstractNodeTypeDefinitionBuilder<T> ntd)
+    private void doChildNodeDefinition(AbstractNodeDefinitionBuilder<T> nd, AbstractNodeTypeDefinitionBuilder<T> ntd)
             throws ParseException {
 
         try {
@@ -629,9 +620,7 @@ public class CompactNodeTypeDefReader<T,
      * @param nd node definition builder
      * @throws ParseException if an error during parsing occurs
      */
-    private void doChildNodeRequiredTypes(AbstractNodeDefinitionBuilder<T> nd)
-            throws ParseException {
-
+    private void doChildNodeRequiredTypes(AbstractNodeDefinitionBuilder<T> nd) throws ParseException {
         if (!currentTokenEquals(Lexer.BEGIN_TYPE)) {
             return;
         }
@@ -654,9 +643,7 @@ public class CompactNodeTypeDefReader<T,
      * @param nd node definition builder
      * @throws ParseException if an error during parsing occurs
      */
-    private void doChildNodeDefaultType(AbstractNodeDefinitionBuilder<T> nd)
-            throws ParseException {
-
+    private void doChildNodeDefaultType(AbstractNodeDefinitionBuilder<T> nd) throws ParseException {
         if (!currentTokenEquals(Lexer.DEFAULT)) {
             return;
         }
@@ -676,8 +663,7 @@ public class CompactNodeTypeDefReader<T,
      * @param ntd declaring nodetype definition builder
      * @throws ParseException if an error during parsing occurs
      */
-    private void doChildNodeAttributes(AbstractNodeDefinitionBuilder<T> nd,
-                                       AbstractNodeTypeDefinitionBuilder<T> ntd)
+    private void doChildNodeAttributes(AbstractNodeDefinitionBuilder<T> nd, AbstractNodeTypeDefinitionBuilder<T> ntd)
             throws ParseException {
 
         try {
@@ -727,7 +713,7 @@ public class CompactNodeTypeDefReader<T,
      * argument ignoring the case.
      *
      * @param s the tokens to compare with
-     * @return <code>true</code> if equals; <code>false</code> otherwise.
+     * @return {@code true} if equals; {@code false} otherwise.
      */
     private boolean currentTokenEquals(String[] s) {
         for (String value : s) {
@@ -743,7 +729,7 @@ public class CompactNodeTypeDefReader<T,
      * argument.
      *
      * @param c the tokens to compare with
-     * @return <code>true</code> if equals; <code>false</code> otherwise.
+     * @return {@code true} if equals; {@code false} otherwise.
      */
     private boolean currentTokenEquals(char c) {
         return currentToken.length() == 1 && currentToken.charAt(0) == c;
@@ -754,7 +740,7 @@ public class CompactNodeTypeDefReader<T,
      * argument.
      *
      * @param s the tokens to compare with
-     * @return <code>true</code> if equals; <code>false</code> otherwise.
+     * @return {@code true} if equals; {@code false} otherwise.
      */
     private boolean currentTokenEquals(String s) {
         return currentToken.equals(s);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefWriter.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefWriter.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CompactNodeTypeDefWriter.java Thu Sep  8 11:50:44 2011
@@ -89,10 +89,10 @@ public class CompactNodeTypeDefWriter {
      *
      * @param out the underlying writer
      * @param session repository session
-     * @param includeNS if <code>true</code> all used namespace decl. are also
+     * @param includeNS if {@code true} all used namespace decl. are also
      *                  written to the writer
      */
-    public CompactNodeTypeDefWriter(Writer out, final Session session, boolean includeNS) {
+    public CompactNodeTypeDefWriter(Writer out, Session session, boolean includeNS) {
         this(out, new DefaultNamespaceMapping(session), includeNS);
     }
 
@@ -101,17 +101,17 @@ public class CompactNodeTypeDefWriter {
      *
      * @param out the underlying writer
      * @param nsMapping the mapping from prefix to namespace URI.
-     * @param includeNS if <code>true</code> all used namespace decl. are also
+     * @param includeNS if {@code true} all used namespace decl. are also
      *                  written to the writer
      */
     public CompactNodeTypeDefWriter(Writer out, NamespaceMapping nsMapping, boolean includeNS) {
         this.nsMapping = nsMapping;
         if (includeNS) {
             this.out = new StringWriter();
-            this.nsWriter = out;
+            nsWriter = out;
         } else {
             this.out = out;
-            this.nsWriter = null;
+            nsWriter = null;
         }
     }
 
@@ -124,8 +124,7 @@ public class CompactNodeTypeDefWriter {
      * @param out output writer
      * @throws java.io.IOException if an I/O error occurs
      */
-    public static void write(Collection<NodeTypeDefinition> defs,
-                             Session session, Writer out) throws IOException {
+    public static void write(Collection<NodeTypeDefinition> defs, Session session, Writer out) throws IOException {
         CompactNodeTypeDefWriter w = new CompactNodeTypeDefWriter(out, session, true);
         for (NodeTypeDefinition def : defs) {
             w.write(def);
@@ -142,8 +141,9 @@ public class CompactNodeTypeDefWriter {
      * @param out output writer
      * @throws java.io.IOException if an I/O error occurs
      */
-    public static void write(Collection<NodeTypeDefinition> defs,
-                             NamespaceMapping nsMapping, Writer out) throws IOException {
+    public static void write(Collection<NodeTypeDefinition> defs, NamespaceMapping nsMapping, Writer out)
+            throws IOException {
+
         CompactNodeTypeDefWriter w = new CompactNodeTypeDefWriter(out, nsMapping, true);
         for (NodeTypeDefinition def : defs) {
             w.write(def);
@@ -161,15 +161,15 @@ public class CompactNodeTypeDefWriter {
         writeName(ntd);
         writeSupertypes(ntd);
         writeOptions(ntd);
-        PropertyDefinition[] pdefs = ntd.getDeclaredPropertyDefinitions();
-        if (pdefs != null) {
-            for (PropertyDefinition pd : pdefs) {
+        PropertyDefinition[] pDefs = ntd.getDeclaredPropertyDefinitions();
+        if (pDefs != null) {
+            for (PropertyDefinition pd : pDefs) {
                 writePropDef(pd);
             }
         }
-        NodeDefinition[] ndefs = ntd.getDeclaredChildNodeDefinitions();
-        if (ndefs != null) {
-            for (NodeDefinition nd : ndefs) {
+        NodeDefinition[] nDefs = ntd.getDeclaredChildNodeDefinitions();
+        if (nDefs != null) {
+            for (NodeDefinition nd : nDefs) {
                 writeNodeDef(nd);
             }
         }
@@ -239,11 +239,11 @@ public class CompactNodeTypeDefWriter {
             }
         }
         if (!supertypes.isEmpty()) {
-            String delim = " " + Lexer.EXTENDS + " ";
+            String del = " " + Lexer.EXTENDS + ' ';
             for (String name : supertypes) {
-                out.write(delim);
+                out.write(del);
                 writeJcrName(name);
-                delim = ", ";
+                del = ", ";
             }
         }
     }
@@ -274,7 +274,7 @@ public class CompactNodeTypeDefWriter {
         }
         for (int i = 0; i < options.size(); i++) {
             if (i == 0) {
-                out.write("\n" + INDENT);
+                out.write('\n' + INDENT);
             } else {
                 out.write(" ");
             }
@@ -294,7 +294,7 @@ public class CompactNodeTypeDefWriter {
      * @throws IOException if an I/O error occurs
      */
     private void writePropDef(PropertyDefinition pd) throws IOException {
-        out.write("\n" + INDENT + Lexer.PROPERTY_DEFINITION + " ");
+        out.write('\n' + INDENT + Lexer.PROPERTY_DEFINITION + ' ');
 
         writeJcrName(pd.getName());
         out.write(" ");
@@ -330,18 +330,18 @@ public class CompactNodeTypeDefWriter {
             out.write(" ");
             out.write(Lexer.NOQUERYORDER[0]);
         }
-        String[] qops = pd.getAvailableQueryOperators();
-        if (qops != null && qops.length > 0) {
-            List<String> opts = new ArrayList<String>(Arrays.asList(qops));
+        String[] ops = pd.getAvailableQueryOperators();
+        if (ops != null && ops.length > 0) {
+            List<String> opts = new ArrayList<String>(Arrays.asList(ops));
             List<String> defaultOps = Arrays.asList(Operator.getAllQueryOperators());
             if (!opts.containsAll(defaultOps)) {
                 out.write(" ");
                 out.write(Lexer.QUERYOPS[0]);
                 out.write(" '");
-                String delim = "";
+                String del = "";
                 for (String opt: opts) {
-                    out.write(delim);
-                    delim= ", ";
+                    out.write(del);
+                    del= ", ";
                     if (opt.equals(QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO)) {
                         out.write(Lexer.QUEROPS_EQUAL);
                     } else if (opt.equals(QueryObjectModelConstants.JCR_OPERATOR_NOT_EQUAL_TO)) {
@@ -372,16 +372,16 @@ public class CompactNodeTypeDefWriter {
      */
     private void writeDefaultValues(Value[] dva) throws IOException {
         if (dva != null && dva.length > 0) {
-            String delim = " = '";
+            String del = " = '";
             for (Value value : dva) {
-                out.write(delim);
+                out.write(del);
                 try {
                     out.write(escape(value.getString()));
                 } catch (RepositoryException e) {
                     out.write(escape(value.toString()));
                 }
                 out.write("'");
-                delim = ", '";
+                del = ", '";
             }
         }
     }
@@ -415,7 +415,7 @@ public class CompactNodeTypeDefWriter {
      * @throws IOException if an I/O error occurs
      */
     private void writeNodeDef(NodeDefinition nd) throws IOException {
-        out.write("\n" + INDENT + Lexer.CHILD_NODE_DEFINITION + " ");
+        out.write('\n' + INDENT + Lexer.CHILD_NODE_DEFINITION + ' ');
 
         writeJcrName(nd.getName());
         writeRequiredTypes(nd.getRequiredPrimaryTypeNames());
@@ -449,11 +449,11 @@ public class CompactNodeTypeDefWriter {
      */
     private void writeRequiredTypes(String[] reqTypes) throws IOException {
         if (reqTypes != null && reqTypes.length > 0) {
-            String delim = " " + Lexer.BEGIN_TYPE;
+            String del = " " + Lexer.BEGIN_TYPE;
             for (String reqType : reqTypes) {
-                out.write(delim);
+                out.write(del);
                 writeJcrName(reqType);
-                delim = ", ";
+                del = ", ";
             }
             out.write(Lexer.END_TYPE);
         }
@@ -490,11 +490,11 @@ public class CompactNodeTypeDefWriter {
         }
 
         String localName = Text.getLocalName(name);
-        String encLocalName = (ANY.equals(localName)) ? ANY : ISO9075.encode(Text.getLocalName(name));
+        String encLocalName = ANY.equals(localName) ? ANY : ISO9075.encode(Text.getLocalName(name));
         String resolvedName = prefix + encLocalName;
 
         // check for '-' and '+'
-        boolean quotesNeeded = (name.indexOf('-') >= 0 || name.indexOf('+') >= 0);
+        boolean quotesNeeded = name.indexOf('-') >= 0 || name.indexOf('+') >= 0;
         if (quotesNeeded) {
             out.write("'");
             out.write(resolvedName);
@@ -509,8 +509,8 @@ public class CompactNodeTypeDefWriter {
      * @param s string
      * @return the escaped string
      */
-    private String escape(String s) {
-        StringBuffer sb = new StringBuffer(s);
+    private static String escape(String s) {
+        StringBuilder sb = new StringBuilder(s);
         for (int i = 0; i < sb.length(); i++) {
             if (sb.charAt(i) == '\\') {
                 sb.insert(i, '\\');
@@ -533,7 +533,7 @@ public class CompactNodeTypeDefWriter {
     }
 
     /**
-     * Default implementation using <code>Session</code> to determine
+     * Default implementation using {@code Session} to determine
      * the namespace URI.
      */
     private static class DefaultNamespaceMapping implements NamespaceMapping {
@@ -544,6 +544,7 @@ public class CompactNodeTypeDefWriter {
             this.session = session;
         }
 
+        @Override
         public String getNamespaceURI(String prefix) {
             try {
                 return session.getNamespaceURI(prefix);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/DefinitionBuilderFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/DefinitionBuilderFactory.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/DefinitionBuilderFactory.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/DefinitionBuilderFactory.java Thu Sep  8 11:50:44 2011
@@ -61,7 +61,7 @@ public abstract class DefinitionBuilderF
      * Builder for a node type definition of type T.
      * @param <T>
      */
-    public static abstract class AbstractNodeTypeDefinitionBuilder<T> {
+    public abstract static class AbstractNodeTypeDefinitionBuilder<T> {
 
         /** See {@link #setName(String)} */
         protected String name;
@@ -106,22 +106,22 @@ public abstract class DefinitionBuilderF
         public abstract void addSupertype(String name) throws RepositoryException;
 
         /**
-         * @param isMixin <code>true</code> if building a mixin node type
-         * definition; <code>false</code> otherwise.
+         * @param isMixin {@code true} if building a mixin node type
+         * definition; {@code false} otherwise.
          * @throws RepositoryException
          * @see NodeTypeDefinition#isMixin()
          */
-        public void setMixin(boolean isMixin) throws RepositoryException {
+        public void setMixin(boolean isMixin) {
             this.isMixin = isMixin;
         }
 
         /**
-         * @param isOrderable <code>true</code> if building a node type having
-         * orderable child nodes; <code>false</code> otherwise.
+         * @param isOrderable {@code true} if building a node type having
+         * orderable child nodes; {@code false} otherwise.
          * @throws RepositoryException
          * @see NodeTypeDefinition#hasOrderableChildNodes()
          */
-        public void setOrderableChildNodes(boolean isOrderable) throws RepositoryException {
+        public void setOrderableChildNodes(boolean isOrderable) {
             this.isOrderable = isOrderable;
         }
 
@@ -133,20 +133,20 @@ public abstract class DefinitionBuilderF
         public abstract void setPrimaryItemName(String name) throws RepositoryException;
 
         /**
-         * @param isAbstract <code>true</code> if building a node type that is abstract.
+         * @param isAbstract {@code true} if building a node type that is abstract.
          * @throws RepositoryException
          * @see NodeTypeDefinition#isAbstract()
          */
-        public void setAbstract(boolean isAbstract) throws RepositoryException {
+        public void setAbstract(boolean isAbstract) {
             this.isAbstract = isAbstract;
         }
 
         /**
-         * @param queryable <code>true</code> if building a node type that is queryable
+         * @param queryable {@code true} if building a node type that is queryable
          * @throws RepositoryException
          * @see NodeTypeDefinition#isQueryable()
          */
-        public void setQueryable(boolean queryable) throws RepositoryException {
+        public void setQueryable(boolean queryable) {
             this.queryable = queryable;
         }
 
@@ -176,10 +176,10 @@ public abstract class DefinitionBuilderF
     }
 
     /**
-     * Builder for item definitions of type <code>T</code>
+     * Builder for item definitions of type {@code T}
      * @param <T>
      */
-    public static abstract class AbstractItemDefinitionBuilder<T> {
+    public abstract static class AbstractItemDefinitionBuilder<T> {
 
         /** See {@link #setName(String)} */
         protected String name;
@@ -221,7 +221,7 @@ public abstract class DefinitionBuilderF
         public abstract void setDeclaringNodeType(String name) throws RepositoryException;
 
         /**
-         * @param autocreate <code>true</code> if building a 'autocreate' child item
+         * @param autocreate {@code true} if building a 'autocreate' child item
          * definition, false otherwise.
          * @throws RepositoryException
          * @see ItemDefinition#isAutoCreated()
@@ -240,7 +240,7 @@ public abstract class DefinitionBuilderF
         }
 
         /**
-         * @param isProtected <code>true</code> if building a 'protected' child
+         * @param isProtected {@code true} if building a 'protected' child
          * item definition, false otherwise.
          * @throws RepositoryException
          * @see ItemDefinition#isProtected()
@@ -250,7 +250,7 @@ public abstract class DefinitionBuilderF
         }
 
         /**
-         * @param isMandatory <code>true</code> if building a 'mandatory' child
+         * @param isMandatory {@code true} if building a 'mandatory' child
          * item definition, false otherwise.
          * @throws RepositoryException
          */
@@ -266,10 +266,10 @@ public abstract class DefinitionBuilderF
     }
 
     /**
-     * Builder for property definitions of type <code>T</code>
+     * Builder for property definitions of type {@code T}
      * @param <T>
      */
-    public static abstract class AbstractPropertyDefinitionBuilder<T> extends AbstractItemDefinitionBuilder<T> {
+    public abstract static class AbstractPropertyDefinitionBuilder<T> extends AbstractItemDefinitionBuilder<T> {
 
         private static final String[] ALL_OPERATORS = new String[]{
                 QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
@@ -285,7 +285,7 @@ public abstract class DefinitionBuilderF
         protected int requiredType = PropertyType.UNDEFINED;
 
         /** See {@link #setMultiple(boolean)} */
-        protected boolean isMultiple = false;
+        protected boolean isMultiple;
 
         /** See {@link #setFullTextSearchable(boolean)} */
         protected boolean fullTextSearchable = true;
@@ -302,7 +302,7 @@ public abstract class DefinitionBuilderF
          * @see PropertyDefinition#getRequiredType()
          */
         public void setRequiredType(int type) throws RepositoryException {
-            this.requiredType = type;
+            requiredType = type;
         }
 
         /**
@@ -339,7 +339,7 @@ public abstract class DefinitionBuilderF
         }
 
         /**
-         * @param fullTextSearchable <code>true</code> if building a
+         * @param fullTextSearchable {@code true} if building a
          * 'fulltext searchable' property definition
          * @throws RepositoryException
          * @see PropertyDefinition#isFullTextSearchable()
@@ -349,7 +349,7 @@ public abstract class DefinitionBuilderF
         }
 
         /**
-         * @param queryOrderable <code>true</code> if the property is orderable in a query
+         * @param queryOrderable {@code true} if the property is orderable in a query
          * @throws RepositoryException
          * @see PropertyDefinition#isQueryOrderable()
          */
@@ -371,10 +371,10 @@ public abstract class DefinitionBuilderF
     }
 
     /**
-     * Builder for child node definitions of type <code>T</code>
+     * Builder for child node definitions of type {@code T}
      * @param <T>
      */
-    public static abstract class AbstractNodeDefinitionBuilder<T> extends AbstractItemDefinitionBuilder<T> {
+    public abstract static class AbstractNodeDefinitionBuilder<T> extends AbstractItemDefinitionBuilder<T> {
         protected boolean allowSns;
 
         /**

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/ParseException.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/ParseException.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/ParseException.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/ParseException.java Thu Sep  8 11:50:44 2011
@@ -32,19 +32,18 @@ public class ParseException extends Exce
     private final int colNumber;
 
     /**
-     * the systemid of the source that produced the error
+     * the system id of the source that produced the error
      */
     private final String systemId;
 
     /**
-     * Constructs a new instance of this class with <code>null</code> as its
+     * Constructs a new instance of this class with {@code null} as its
      * detail message.
      * @param lineNumber line number
      * @param colNumber columns number
      * @param systemId system id
      */
     public ParseException(int lineNumber, int colNumber, String systemId) {
-        super();
         this.lineNumber = lineNumber;
         this.colNumber = colNumber;
         this.systemId = systemId;
@@ -100,39 +99,34 @@ public class ParseException extends Exce
         this.systemId = systemId;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
     public String getMessage() {
         String message = super.getMessage();
-        StringBuffer b = new StringBuffer(message == null ? "" : message);
-        String delim = " (";
-        if (systemId != null && !systemId.equals("")) {
-            b.append(delim);
+        StringBuilder b = new StringBuilder(message == null ? "" : message);
+        String del = " (";
+        if (systemId != null && !systemId.isEmpty()) {
+            b.append(del);
             b.append(systemId);
-            delim = ", ";
+            del = ", ";
         }
         if (lineNumber >= 0) {
-            b.append(delim);
+            b.append(del);
             b.append("line ");
             b.append(lineNumber);
-            delim = ", ";
+            del = ", ";
         }
         if (colNumber >= 0) {
-            b.append(delim);
+            b.append(del);
             b.append("col ");
             b.append(colNumber);
-            delim = ", ";
+            del = ", ";
         }
-        if (delim.equals(", ")) {
-            b.append(")");
+        if (del.equals(", ")) {
+            b.append(')');
         }
         return b.toString();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     public String toString() {
         return super.toString(); // + " (" + systemId + ", line " + lineNumber +", col " + colNumber +")";
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventListenerIteratorAdapter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventListenerIteratorAdapter.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventListenerIteratorAdapter.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventListenerIteratorAdapter.java Thu Sep  8 11:50:44 2011
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.commons.iterator;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
 import javax.jcr.RangeIterator;
 import javax.jcr.observation.EventListener;
 import javax.jcr.observation.EventListenerIterator;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 /**
  * Adapter class for turning {@link RangeIterator}s or {@link Iterator}s
@@ -34,8 +34,7 @@ public class EventListenerIteratorAdapte
     /**
      * Static instance of an empty {@link EventListenerIterator}.
      */
-    public static final EventListenerIterator EMPTY =
-        new EventListenerIteratorAdapter(RangeIteratorAdapter.EMPTY);
+    public static final EventListenerIterator EMPTY = new EventListenerIteratorAdapter(Collections.emptyList());
 
     /**
      * Creates an adapter for the given {@link RangeIterator}.
@@ -51,7 +50,7 @@ public class EventListenerIteratorAdapte
      *
      * @param iterator iterator of {@link EventListener}s
      */
-    public EventListenerIteratorAdapter(Iterator iterator) {
+    public EventListenerIteratorAdapter(Iterator<?> iterator) {
         super(new RangeIteratorAdapter(iterator));
     }
 
@@ -60,7 +59,7 @@ public class EventListenerIteratorAdapte
      *
      * @param collection collection of {@link EventListener}s
      */
-    public EventListenerIteratorAdapter(Collection collection) {
+    public EventListenerIteratorAdapter(Collection<?> collection) {
         super(new RangeIteratorAdapter(collection));
     }
 
@@ -72,6 +71,7 @@ public class EventListenerIteratorAdapte
      * @return next event listener
      * @throws NoSuchElementException if there is no next event listener
      */
+    @Override
     public EventListener nextEventListener() {
         return (EventListener) next();
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/FrozenNodeIteratorAdapter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/FrozenNodeIteratorAdapter.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/FrozenNodeIteratorAdapter.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/FrozenNodeIteratorAdapter.java Thu Sep  8 11:50:44 2011
@@ -34,10 +34,9 @@ public class FrozenNodeIteratorAdapter e
     }
 
     /**
-     * {@inheritDoc}
-     *
      * @return the next frozen node.
      */
+    @Override
     public Node nextNode() {
         try {
             return ((Version) next()).getFrozenNode();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeIteratorAdapter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeIteratorAdapter.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeIteratorAdapter.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeIteratorAdapter.java Thu Sep  8 11:50:44 2011
@@ -16,26 +16,24 @@
  */
 package org.apache.jackrabbit.commons.iterator;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RangeIterator;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 /**
  * Adapter class for turning {@link RangeIterator}s or {@link Iterator}s
  * into {@link NodeIterator}s.
  */
-public class NodeIteratorAdapter extends RangeIteratorDecorator
-        implements NodeIterator {
+public class NodeIteratorAdapter extends RangeIteratorDecorator implements NodeIterator {
 
     /**
      * Static instance of an empty {@link NodeIterator}.
      */
-    public static final NodeIterator EMPTY =
-        new NodeIteratorAdapter(RangeIteratorAdapter.EMPTY);
+    public static final NodeIterator EMPTY = new NodeIteratorAdapter(Collections.emptyList());
 
     /**
      * Creates an adapter for the given {@link RangeIterator}.
@@ -51,7 +49,7 @@ public class NodeIteratorAdapter extends
      *
      * @param iterator iterator of {@link Node}s
      */
-    public NodeIteratorAdapter(Iterator iterator) {
+    public NodeIteratorAdapter(Iterator<?> iterator) {
         super(new RangeIteratorAdapter(iterator));
     }
 
@@ -60,7 +58,7 @@ public class NodeIteratorAdapter extends
      *
      * @param collection collection of {@link Node}s
      */
-    public NodeIteratorAdapter(Collection collection) {
+    public NodeIteratorAdapter(Collection<?> collection) {
         super(new RangeIteratorAdapter(collection));
     }
 
@@ -72,6 +70,7 @@ public class NodeIteratorAdapter extends
      * @return next node
      * @throws NoSuchElementException if there is no next node
      */
+    @Override
     public Node nextNode() throws NoSuchElementException {
         return (Node) next();
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeTypeIteratorAdapter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeTypeIteratorAdapter.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeTypeIteratorAdapter.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeTypeIteratorAdapter.java Thu Sep  8 11:50:44 2011
@@ -16,26 +16,24 @@
  */
 package org.apache.jackrabbit.commons.iterator;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
 import javax.jcr.RangeIterator;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeIterator;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 /**
  * Adapter class for turning {@link RangeIterator}s or {@link Iterator}s
  * into {@link NodeTypeIterator}s.
  */
-public class NodeTypeIteratorAdapter extends RangeIteratorDecorator
-        implements NodeTypeIterator {
+public class NodeTypeIteratorAdapter extends RangeIteratorDecorator implements NodeTypeIterator {
 
     /**
      * Static instance of an empty {@link NodeTypeIterator}.
      */
-    public static final NodeTypeIterator EMPTY =
-        new NodeTypeIteratorAdapter(RangeIteratorAdapter.EMPTY);
+    public static final NodeTypeIterator EMPTY = new NodeTypeIteratorAdapter(Collections.emptyList());
 
     /**
      * Creates an adapter for the given {@link RangeIterator}.
@@ -51,7 +49,7 @@ public class NodeTypeIteratorAdapter ext
      *
      * @param iterator iterator of {@link NodeType}s
      */
-    public NodeTypeIteratorAdapter(Iterator iterator) {
+    public NodeTypeIteratorAdapter(Iterator<?> iterator) {
         super(new RangeIteratorAdapter(iterator));
     }
 
@@ -60,7 +58,7 @@ public class NodeTypeIteratorAdapter ext
      *
      * @param collection collection of {@link NodeType}s
      */
-    public NodeTypeIteratorAdapter(Collection<NodeType> collection) {
+    public NodeTypeIteratorAdapter(Collection<?> collection) {
         super(new RangeIteratorAdapter(collection));
     }
 
@@ -72,6 +70,7 @@ public class NodeTypeIteratorAdapter ext
      * @return next node type
      * @throws NoSuchElementException if there is no next node type
      */
+    @Override
     public NodeType nextNodeType() throws NoSuchElementException {
         return (NodeType) next();
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/VersionIteratorAdapter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/VersionIteratorAdapter.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/VersionIteratorAdapter.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/VersionIteratorAdapter.java Thu Sep  8 11:50:44 2011
@@ -16,26 +16,25 @@
  */
 package org.apache.jackrabbit.commons.iterator;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
 import javax.jcr.RangeIterator;
 import javax.jcr.version.Version;
 import javax.jcr.version.VersionIterator;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 /**
  * Adapter class for turning {@link RangeIterator}s or {@link Iterator}s
  * into {@link VersionIterator}s.
  */
-public class VersionIteratorAdapter extends RangeIteratorDecorator
-        implements VersionIterator {
+public class VersionIteratorAdapter extends RangeIteratorDecorator implements VersionIterator {
 
     /**
      * Static instance of an empty {@link VersionIterator}.
      */
     public static final VersionIterator EMPTY =
-        new VersionIteratorAdapter(RangeIteratorAdapter.EMPTY);
+        new VersionIteratorAdapter(Collections.emptyList());
 
     /**
      * Creates an adapter for the given {@link RangeIterator}.
@@ -51,7 +50,7 @@ public class VersionIteratorAdapter exte
      *
      * @param iterator iterator of {@link Version}s
      */
-    public VersionIteratorAdapter(Iterator iterator) {
+    public VersionIteratorAdapter(Iterator<?> iterator) {
         super(new RangeIteratorAdapter(iterator));
     }
 
@@ -60,7 +59,7 @@ public class VersionIteratorAdapter exte
      *
      * @param collection collection of {@link Version}s
      */
-    public VersionIteratorAdapter(Collection collection) {
+    public VersionIteratorAdapter(Collection<?> collection) {
         super(new RangeIteratorAdapter(collection));
     }
 
@@ -72,6 +71,7 @@ public class VersionIteratorAdapter exte
      * @return next version
      * @throws NoSuchElementException if there is no next version
      */
+    @Override
     public Version nextVersion() {
         return (Version) next();
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilder.java?rev=1166638&r1=1166637&r2=1166638&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilder.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilder.java Thu Sep  8 11:50:44 2011
@@ -23,13 +23,13 @@ import javax.jcr.ValueFactory;
 import javax.jcr.RepositoryException;
 
 /**
- * <code>QueryObjectModelBuilder</code> defines an interface for building a
+ * {@code QueryObjectModelBuilder} defines an interface for building a
  * query object model from a string based query statement and vice versa.
  */
 public interface QueryObjectModelBuilder {
 
     /**
-     * Creates a new query object model from the given <code>statement</code>
+     * Creates a new query object model from the given {@code statement}
      * using the passed QOM and value factory.
      *
      * @param statement the query statement.
@@ -39,18 +39,16 @@ public interface QueryObjectModelBuilder
      * @throws InvalidQueryException if the statement is invalid.
      * @throws RepositoryException   if another error occurs.
      */
-    public QueryObjectModel createQueryObjectModel(String statement,
-                                                   QueryObjectModelFactory qf,
-                                                   ValueFactory vf)
+    QueryObjectModel createQueryObjectModel(String statement, QueryObjectModelFactory qf, ValueFactory vf)
             throws InvalidQueryException, RepositoryException;
 
     /**
-     * Returns <code>true</code> if this QOM builder can handle a statement in
-     * <code>language</code>.
+     * Returns {@code true} if this QOM builder can handle a statement in
+     * {@code language}.
      *
      * @param language the language of a query statement to build a QOM.
-     * @return <code>true</code> if this builder can handle
-     *         <code>language</code>; <code>false</code> otherwise.
+     * @return {@code true} if this builder can handle
+     *         {@code language}; {@code false} otherwise.
      */
     boolean canHandle(String language);
 
@@ -63,7 +61,7 @@ public interface QueryObjectModelBuilder
 
     /**
      * Creates a String representation of the query object model in the syntax
-     * this <code>QueryObjectModelBuilder</code> can handle.
+     * this {@code QueryObjectModelBuilder} can handle.
      *
      * @param qom      the query object model.
      * @return a String representation of the QOM.
@@ -71,6 +69,5 @@ public interface QueryObjectModelBuilder
      *                               converted into a String representation due
      *                               to restrictions in this syntax.
      */
-    String toString(QueryObjectModel qom)
-            throws InvalidQueryException;
+    String toString(QueryObjectModel qom) throws InvalidQueryException;
 }