commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r618074 - in /commons/proper/jxpath/trunk: ./ src/java/org/apache/commons/jxpath/ src/java/org/apache/commons/jxpath/ri/axes/ src/java/org/apache/commons/jxpath/ri/compiler/ src/java/org/apache/commons/jxpath/ri/model/ src/java/org/apache/c...
Date Sun, 03 Feb 2008 20:19:32 GMT
Author: mbenson
Date: Sun Feb  3 12:19:24 2008
New Revision: 618074

URL: http://svn.apache.org/viewvc?rev=618074&view=rev
Log:
checkstyle

Modified:
    commons/proper/jxpath/trunk/checkstyle.xml
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/FunctionLibrary.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBeanInfo.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathInvalidAccessException.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/DescendantContext.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/InitialContext.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/RootContext.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAnd.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationGreaterThanOrEqual.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationNotEqual.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationRelationalExpression.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationSubtract.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/NodeTypeTest.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/TreeCompiler.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointerFactory.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/NullPropertyPointer.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicAttributeIterator.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyPointer.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java

Modified: commons/proper/jxpath/trunk/checkstyle.xml
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/checkstyle.xml?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/checkstyle.xml (original)
+++ commons/proper/jxpath/trunk/checkstyle.xml Sun Feb  3 12:19:24 2008
@@ -153,8 +153,9 @@
           <!-- See http://checkstyle.sf.net/config_design.html -->
           <module name="FinalClass"/>
           <module name="InterfaceIsType"/>
-          <module name="VisibilityModifier"/>
-  
+          <module name="VisibilityModifier">
+            <property name="protectedAllowed" value="true" />
+          </module>
   
           <!-- Miscellaneous other checks.                   -->
           <!-- See http://checkstyle.sf.net/config_misc.html -->

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/FunctionLibrary.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/FunctionLibrary.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/FunctionLibrary.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/FunctionLibrary.java Sun Feb  3 12:19:24 2008
@@ -37,6 +37,7 @@
 
     /**
      * Add functions to the library
+     * @param functions to add
      */
     public void addFunctions(Functions functions) {
         allFunctions.add(functions);
@@ -45,6 +46,7 @@
 
     /**
      * Remove functions from the library.
+     * @param functions to remove
      */
     public void removeFunctions(Functions functions) {
         allFunctions.remove(functions);
@@ -54,6 +56,7 @@
     /**
      * Returns a set containing all namespaces used by the aggregated
      * Functions.
+     * @return Set<String>
      */
     public Set getUsedNamespaces() {
         if (byNamespace == null) {
@@ -65,12 +68,13 @@
     /**
      * Returns a Function, if any, for the specified namespace,
      * name and parameter types.
+     * @param namespace function namespace
+     * @param name function name
+     * @param parameters parameters
+     * @return Function found
      */
-    public Function getFunction(
-        String namespace,
-        String name,
-        Object[] parameters)
-    {
+    public Function getFunction(String namespace, String name,
+            Object[] parameters) {
         if (byNamespace == null) {
             prepareCache();
         }
@@ -98,6 +102,9 @@
         return null;
     }
 
+    /**
+     * Prepare the cache.
+     */
     private void prepareCache() {
         byNamespace = new HashMap();
         int count = allFunctions.size();

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java Sun Feb  3 12:19:24 2008
@@ -139,8 +139,9 @@
     }
 
     /**
-     * For  a dynamic class, returns the corresponding DynamicPropertyHandler
+     * For a dynamic class, returns the corresponding DynamicPropertyHandler
      * class.
+     * @return Class
      */
     public Class getDynamicPropertyHandlerClass() {
         return dynamicPropertyHandlerClass;

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBeanInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBeanInfo.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBeanInfo.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBeanInfo.java Sun Feb  3 12:19:24 2008
@@ -39,6 +39,7 @@
      * Returns true if objects of this class are treated as atomic
      * objects which have no properties of their own.
      * For example, java.lang.String and java.lang.Number are atomic.
+     * @return boolean
      */
     boolean isAtomic();
 
@@ -48,18 +49,22 @@
      * should return null and getDynamicPropertyHandlerClass should return
      * a valid class name.  An object cannot have both static and dynamic
      * properties at the same time.
+     * @return boolean
      */
     boolean isDynamic();
 
     /**
      * Returns a list of property descriptors for the beans described by this
      * bean info object.  Returns null for atomic beans.
+     * @return PropertyDescriptor[]
      */
     PropertyDescriptor[] getPropertyDescriptors();
 
     /**
      * Returns a PropertyDescriptor for the specified name or null if there
      * is no such property.
+     * @param propertyName property name
+     * @return PropertyDescriptor
      */
     PropertyDescriptor getPropertyDescriptor(String propertyName);
 
@@ -67,6 +72,7 @@
      * For dynamic objects, returns the class implementing
      * the DynamicPropertyHandler interface. That class can
      * be used to access dynamic properties.
+     * @return Class
      */
     Class getDynamicPropertyHandlerClass();
 }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathInvalidAccessException.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathInvalidAccessException.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathInvalidAccessException.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathInvalidAccessException.java Sun Feb  3 12:19:24 2008
@@ -27,10 +27,19 @@
 
     private static final long serialVersionUID = -8875537628056117241L;
 
+    /**
+     * Create a new JXPathInvalidAccessException.
+     * @param message exception message
+     */
     public JXPathInvalidAccessException(String message) {
         super(message);
     }
 
+    /**
+     * Create a new JXPathInvalidAccessException.
+     * @param message exception message
+     * @param ex precipitating exception
+     */
     public JXPathInvalidAccessException(String message, Throwable ex) {
         super(message, ex);
     }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/DescendantContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/DescendantContext.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/DescendantContext.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/DescendantContext.java Sun Feb  3 12:19:24 2008
@@ -42,20 +42,29 @@
     private static final NodeTest ELEMENT_NODE_TEST =
             new NodeTypeTest(Compiler.NODE_TYPE_NODE);
 
-    public DescendantContext(
-            EvalContext parentContext,
-            boolean includeSelf,
-            NodeTest nodeTest)
-    {
+    /**
+     * Create a new DescendantContext.
+     * @param parentContext parent context
+     * @param includeSelf whether to include this node
+     * @param nodeTest test
+     */
+    public DescendantContext(EvalContext parentContext, boolean includeSelf,
+            NodeTest nodeTest) {
         super(parentContext);
         this.includeSelf = includeSelf;
         this.nodeTest = nodeTest;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isChildOrderingRequired() {
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public NodePointer getCurrentNodePointer() {
         if (position == 0) {
             if (!setPosition(1)) {
@@ -65,11 +74,17 @@
         return currentNodePointer;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void reset() {
         super.reset();
         setStarted = false;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean setPosition(int position) {
         if (position < this.position) {
             reset();
@@ -83,6 +98,9 @@
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean nextNode() {
         if (!setStarted) {
             setStarted = true;
@@ -135,6 +153,7 @@
     /**
      * Checks if we are reentering a bean we have already seen and if so
      * returns true to prevent infinite recursion.
+     * @return boolean
      */
     private boolean isRecursive() {
         Object node = currentNodePointer.getNode();

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/InitialContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/InitialContext.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/InitialContext.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/InitialContext.java Sun Feb  3 12:19:24 2008
@@ -33,6 +33,10 @@
     private boolean collection;
     private NodePointer nodePointer;
 
+    /**
+     * Create a new InitialContext.
+     * @param parentContext parent context
+     */
     public InitialContext(EvalContext parentContext) {
         super(parentContext);
         nodePointer =
@@ -43,22 +47,37 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Pointer getSingleNodePointer() {
         return nodePointer;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public NodePointer getCurrentNodePointer() {
         return nodePointer;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object getValue() {
         return nodePointer.getValue();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean nextNode() {
         return setPosition(position + 1);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean setPosition(int position) {
         this.position = position;
         if (collection) {
@@ -71,6 +90,9 @@
         return position == 1;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean nextSet() {
         if (started) {
             return false;

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/RootContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/RootContext.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/RootContext.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/RootContext.java Sun Feb  3 12:19:24 2008
@@ -165,7 +165,7 @@
     }
 
     /**
-     * Get a registered value. 
+     * Get a registered value.
      * @param id int
      * @return Object
      */

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAnd.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAnd.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAnd.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAnd.java Sun Feb  3 12:19:24 2008
@@ -27,10 +27,17 @@
  */
 public class CoreOperationAnd extends CoreOperation {
 
+    /**
+     * Create a new CoreOperationAnd.
+     * @param args to combine
+     */
     public CoreOperationAnd(Expression[] args) {
         super(args);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object computeValue(EvalContext context) {
         for (int i = 0; i < args.length; i++) {
             if (!InfoSetUtil.booleanValue(args[i].computeValue(context))) {
@@ -40,14 +47,23 @@
         return Boolean.TRUE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected int getPrecedence() {
         return AND_PRECEDENCE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected boolean isSymmetric() {
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String getSymbol() {
         return "and";
     }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java Sun Feb  3 12:19:24 2008
@@ -36,35 +36,56 @@
 public abstract class CoreOperationCompare extends CoreOperation {
     private boolean invert;
 
+    /**
+     * Create a new CoreOperationCompare.
+     * @param arg1 left operand
+     * @param arg2 right operand
+     */
     public CoreOperationCompare(Expression arg1, Expression arg2) {
         this(arg1, arg2, false);
     }
 
+    /**
+     * Create a new CoreOperationCompare.
+     * @param arg1 left operand
+     * @param arg2 right operand
+     * @param invert whether to invert (not) the comparison
+     */
     protected CoreOperationCompare(Expression arg1, Expression arg2, boolean invert) {
         super(new Expression[] { arg1, arg2 });
         this.invert = invert;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object computeValue(EvalContext context) {
         return equal(context, args[0], args[1]) ? Boolean.TRUE : Boolean.FALSE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected int getPrecedence() {
         return COMPARE_PRECEDENCE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected boolean isSymmetric() {
         return true;
     }
 
     /**
-     * Compares two values
+     * Compares two values.
+     * @param context evaluation context
+     * @param left operand
+     * @param right operand
+     * @return whether left = right in XPath terms
      */
-    protected boolean equal(
-        EvalContext context,
-        Expression left,
-        Expression right)
-    {
+    protected boolean equal(EvalContext context, Expression left,
+            Expression right) {
         Object l = left.compute(context);
         Object r = right.compute(context);
 
@@ -104,6 +125,12 @@
         return equal(l, r);
     }
 
+    /**
+     * Learn whether it contains value.
+     * @param it Iterator to check
+     * @param value for which to look
+     * @return whether value was found
+     */
     protected boolean contains(Iterator it, Object value) {
         while (it.hasNext()) {
             Object element = it.next();
@@ -114,6 +141,12 @@
         return false;
     }
 
+    /**
+     * Learn whether lit intersects rit.
+     * @param lit left Iterator
+     * @param rit right Iterator
+     * @return boolean
+     */
     protected boolean findMatch(Iterator lit, Iterator rit) {
         HashSet left = new HashSet();
         while (lit.hasNext()) {
@@ -127,6 +160,12 @@
         return false;
     }
 
+    /**
+     * Learn whether l equals r in XPath terms.
+     * @param l left operand
+     * @param r right operand
+     * @return whether l = r
+     */
     protected boolean equal(Object l, Object r) {
         if (l instanceof Pointer) {
             l = ((Pointer) l).getValue();
@@ -139,7 +178,8 @@
         boolean result;
         if (l instanceof Boolean || r instanceof Boolean) {
             result = l == r || InfoSetUtil.booleanValue(l) == InfoSetUtil.booleanValue(r);
-        } else if (l instanceof Number || r instanceof Number) {
+        }
+        else if (l instanceof Number || r instanceof Number) {
             //if either side is NaN, no comparison returns true:
             double ld = InfoSetUtil.doubleValue(l);
             if (Double.isNaN(ld)) {
@@ -150,7 +190,8 @@
                 return false;
             }
             result = ld == rd;
-        } else {
+        }
+        else {
             if (l instanceof String || r instanceof String) {
                 l = InfoSetUtil.stringValue(l);
                 r = InfoSetUtil.stringValue(r);

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationGreaterThanOrEqual.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationGreaterThanOrEqual.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationGreaterThanOrEqual.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationGreaterThanOrEqual.java Sun Feb  3 12:19:24 2008
@@ -25,14 +25,25 @@
 public class CoreOperationGreaterThanOrEqual extends
         CoreOperationRelationalExpression {
 
+    /**
+     * Create a new CoreOperationGreaterThanOrEqual.
+     * @param arg1 operand 1
+     * @param arg2 operand 2
+     */
     public CoreOperationGreaterThanOrEqual(Expression arg1, Expression arg2) {
         super(new Expression[] { arg1, arg2 });
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected boolean evaluateCompare(int compare) {
         return compare >= 0;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String getSymbol() {
         return ">=";
     }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationNotEqual.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationNotEqual.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationNotEqual.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationNotEqual.java Sun Feb  3 12:19:24 2008
@@ -24,10 +24,18 @@
  */
 public class CoreOperationNotEqual extends CoreOperationCompare {
 
+    /**
+     * Create a new CoreOperationNotEqual.
+     * @param arg1 left operand
+     * @param arg2 right operand
+     */
     public CoreOperationNotEqual(Expression arg1, Expression arg2) {
         super(arg1, arg2, true);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String getSymbol() {
         return "!=";
     }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationRelationalExpression.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationRelationalExpression.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationRelationalExpression.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationRelationalExpression.java Sun Feb  3 12:19:24 2008
@@ -34,25 +34,49 @@
  */
 public abstract class CoreOperationRelationalExpression extends CoreOperation {
 
+    /**
+     * Create a new CoreOperationRelationalExpression.
+     * @param args arguments
+     */
     protected CoreOperationRelationalExpression(Expression[] args) {
         super(args);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public final Object computeValue(EvalContext context) {
         return compute(args[0].compute(context), args[1].compute(context))
                 ? Boolean.TRUE : Boolean.FALSE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected final int getPrecedence() {
         return RELATIONAL_EXPR_PRECEDENCE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected final boolean isSymmetric() {
         return false;
     }
 
+    /**
+     * Template method for subclasses to evaluate the result of a comparison.
+     * @param compare result of comparison to evaluate 
+     * @return ultimate operation success/failure
+     */
     protected abstract boolean evaluateCompare(int compare);
 
+    /**
+     * Compare left to right.
+     * @param left left operand
+     * @param right right operand
+     * @return operation success/failure
+     */
     private boolean compute(Object left, Object right) {
         left = reduce(left);
         right = reduce(right);
@@ -83,6 +107,11 @@
         return evaluateCompare(ld == rd ? 0 : ld < rd ? -1 : 1);
     }
 
+    /**
+     * Reduce an operand for comparison.
+     * @param o Object to reduce
+     * @return reduced operand
+     */
     private Object reduce(Object o) {
         if (o instanceof SelfContext) {
             o = ((EvalContext) o).getSingleNodePointer();
@@ -93,6 +122,12 @@
         return o;
     }
 
+    /**
+     * Learn whether any element returned from an Iterator matches a given value.
+     * @param it Iterator
+     * @param value to look for
+     * @return whether a match was found
+     */
     private boolean containsMatch(Iterator it, Object value) {
         while (it.hasNext()) {
             Object element = it.next();
@@ -103,6 +138,12 @@
         return false;
     }
 
+    /**
+     * Learn whether there is an intersection between two Iterators.
+     * @param lit left Iterator
+     * @param rit right Iterator
+     * @return whether a match was found
+     */
     private boolean findMatch(Iterator lit, Iterator rit) {
         HashSet left = new HashSet();
         while (lit.hasNext()) {

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationSubtract.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationSubtract.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationSubtract.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationSubtract.java Sun Feb  3 12:19:24 2008
@@ -27,24 +27,41 @@
  */
 public class CoreOperationSubtract extends CoreOperation {
 
+    /**
+     * Create a new CoreOperationSubtract.
+     * @param arg1 minuend
+     * @param arg2 subtrahend
+     */
     public CoreOperationSubtract(Expression arg1, Expression arg2) {
         super(new Expression[] { arg1, arg2 });
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object computeValue(EvalContext context) {
         double l = InfoSetUtil.doubleValue(args[0].computeValue(context));
         double r = InfoSetUtil.doubleValue(args[1].computeValue(context));
         return new Double(l - r);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected int getPrecedence() {
         return ADD_PRECEDENCE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected boolean isSymmetric() {
         return false;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String getSymbol() {
         return "-";
     }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/NodeTypeTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/NodeTypeTest.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/NodeTypeTest.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/NodeTypeTest.java Sun Feb  3 12:19:24 2008
@@ -25,18 +25,34 @@
 public class NodeTypeTest extends NodeTest {
     private int nodeType;
 
+    /**
+     * Create a new NodeTypeTest.
+     * @param nodeType to match
+     */
     public NodeTypeTest(int nodeType) {
         this.nodeType = nodeType;
     }
 
+    /**
+     * Get the nodeType.
+     * @return int
+     */
     public int getNodeType() {
         return nodeType;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return nodeTypeToString(nodeType) + "()";
     }
 
+    /**
+     * Render the given node type as a String.
+     * @param code int
+     * @return String
+     */
     public static String nodeTypeToString(int code) {
         switch (code) {
             case Compiler.NODE_TYPE_NODE :

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/TreeCompiler.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/TreeCompiler.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/TreeCompiler.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/TreeCompiler.java Sun Feb  3 12:19:24 2008
@@ -27,127 +27,205 @@
 
     private static final QName QNAME_NAME = new QName(null, "name");
 
+    /**
+     * {@inheritDoc}
+     */
     public Object number(String value) {
         return new Constant(new Double(value));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object literal(String value) {
         return new Constant(value);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object qname(String prefix, String name) {
         return new QName(prefix, name);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object sum(Object[] arguments) {
         return new CoreOperationAdd(toExpressionArray(arguments));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object minus(Object left, Object right) {
         return new CoreOperationSubtract(
             (Expression) left,
             (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object multiply(Object left, Object right) {
         return new CoreOperationMultiply((Expression) left, (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object divide(Object left, Object right) {
         return new CoreOperationDivide((Expression) left, (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object mod(Object left, Object right) {
         return new CoreOperationMod((Expression) left, (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object lessThan(Object left, Object right) {
         return new CoreOperationLessThan((Expression) left, (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object lessThanOrEqual(Object left, Object right) {
         return new CoreOperationLessThanOrEqual(
             (Expression) left,
             (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object greaterThan(Object left, Object right) {
         return new CoreOperationGreaterThan(
             (Expression) left,
             (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object greaterThanOrEqual(Object left, Object right) {
         return new CoreOperationGreaterThanOrEqual(
             (Expression) left,
             (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object equal(Object left, Object right) {
         return isNameAttributeTest((Expression) left)
                 ? new NameAttributeTest((Expression) left, (Expression) right)
                 : new CoreOperationEqual((Expression) left, (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object notEqual(Object left, Object right) {
         return new CoreOperationNotEqual((Expression) left, (Expression) right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object minus(Object argument) {
         return new CoreOperationNegate((Expression) argument);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object variableReference(Object qName) {
         return new VariableReference((QName) qName);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object function(int code, Object[] args) {
         return new CoreFunction(code, toExpressionArray(args));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object function(Object name, Object[] args) {
         return new ExtensionFunction((QName) name, toExpressionArray(args));
     }
 
-    public Object and(Object arguments[]) {
+    /**
+     * {@inheritDoc}
+     */
+    public Object and(Object[] arguments) {
         return new CoreOperationAnd(toExpressionArray(arguments));
     }
 
-    public Object or(Object arguments[]) {
+    /**
+     * {@inheritDoc}
+     */
+    public Object or(Object[] arguments) {
         return new CoreOperationOr(toExpressionArray(arguments));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object union(Object[] arguments) {
         return new CoreOperationUnion(toExpressionArray(arguments));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object locationPath(boolean absolute, Object[] steps) {
         return new LocationPath(absolute, toStepArray(steps));
     }
 
-    public Object expressionPath(
-        Object expression,
-        Object[] predicates,
-        Object[] steps)
-    {
+    /**
+     * {@inheritDoc}
+     */
+    public Object expressionPath(Object expression, Object[] predicates,
+            Object[] steps) {
         return new ExpressionPath(
             (Expression) expression,
             toExpressionArray(predicates),
             toStepArray(steps));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object nodeNameTest(Object qname) {
         return new NodeNameTest((QName) qname);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object nodeTypeTest(int nodeType) {
         return new NodeTypeTest(nodeType);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object processingInstructionTest(String instruction) {
         return new ProcessingInstructionTest(instruction);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object step(int axis, Object nodeTest, Object[] predicates) {
         return new Step(
             axis,
@@ -155,8 +233,13 @@
             toExpressionArray(predicates));
     }
 
+    /**
+     * Get an Object[] as an Expression[].
+     * @param array Object[]
+     * @return Expression[]
+     */
     private Expression[] toExpressionArray(Object[] array) {
-        Expression expArray[] = null;
+        Expression[] expArray = null;
         if (array != null) {
             expArray = new Expression[array.length];
             for (int i = 0; i < expArray.length; i++) {
@@ -166,8 +249,13 @@
         return expArray;
     }
 
+    /**
+     * Get an Object[] as a Step[].
+     * @param array Object[]
+     * @return Step[]
+     */
     private Step[] toStepArray(Object[] array) {
-        Step stepArray[] = null;
+        Step[] stepArray = null;
         if (array != null) {
             stepArray = new Step[array.length];
             for (int i = 0; i < stepArray.length; i++) {
@@ -177,6 +265,11 @@
         return stepArray;
     }
 
+    /**
+     * Learn whether arg is a name attribute test.
+     * @param arg Expression to test
+     * @return boolean
+     */
     private boolean isNameAttributeTest(Expression arg) {
         if (!(arg instanceof LocationPath)) {
             return false;

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/VariablePointerFactory.java Sun Feb  3 12:19:24 2008
@@ -29,14 +29,19 @@
  * @version $Revision$ $Date$
  */
 public class VariablePointerFactory implements NodePointerFactory {
+    /** factory order constant */
     public static final int VARIABLE_POINTER_FACTORY_ORDER = 890;
 
     /**
      * Node value wrapper to trigger a VariablePointerFactory.
      */
-    public static class VariableContextWrapper {
+    public static final class VariableContextWrapper {
         private final JXPathContext context;
 
+        /**
+         * Create a new VariableContextWrapper.
+         * @param context to wrap
+         */
         private VariableContextWrapper(JXPathContext context) {
             this.context = context;
         }
@@ -60,11 +65,8 @@
         return new VariableContextWrapper(context);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.apache.commons.jxpath.ri.model.NodePointerFactory#createNodePointer(org.apache.commons.jxpath.ri.QName,
-     *      java.lang.Object, java.util.Locale)
+    /**
+     * {@inheritDoc}
      */
     public NodePointer createNodePointer(QName name, Object object,
             Locale locale) {
@@ -85,21 +87,16 @@
         return null;
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.apache.commons.jxpath.ri.model.NodePointerFactory#createNodePointer(org.apache.commons.jxpath.ri.model.NodePointer,
-     *      org.apache.commons.jxpath.ri.QName, java.lang.Object)
+    /**
+     * {@inheritDoc}
      */
     public NodePointer createNodePointer(NodePointer parent, QName name,
             Object object) {
         return createNodePointer(name, object, null);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.apache.commons.jxpath.ri.model.NodePointerFactory#getOrder()
+    /**
+     * {@inheritDoc}
      */
     public int getOrder() {
         return VARIABLE_POINTER_FACTORY_ORDER;

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointerFactory.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointerFactory.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointerFactory.java Sun Feb  3 12:19:24 2008
@@ -31,25 +31,28 @@
  */
 public class CollectionPointerFactory implements NodePointerFactory {
 
+    /** factory order constant */
     public static final int COLLECTION_POINTER_FACTORY_ORDER = 10;
 
+    /**
+     * {@inheritDoc}
+     */
     public int getOrder() {
         return COLLECTION_POINTER_FACTORY_ORDER;
     }
 
-    public NodePointer createNodePointer(
-        QName name,
-        Object bean,
-        Locale locale)
-    {
+    /**
+     * {@inheritDoc}
+     */
+    public NodePointer createNodePointer(QName name, Object bean, Locale locale) {
         return ValueUtils.isCollection(bean) ? new CollectionPointer(bean, locale) : null;
     }
 
-    public NodePointer createNodePointer(
-        NodePointer parent,
-        QName name,
-        Object bean)
-    {
+    /**
+     * {@inheritDoc}
+     */
+    public NodePointer createNodePointer(NodePointer parent, QName name,
+            Object bean) {
         return ValueUtils.isCollection(bean) ? new CollectionPointer(parent, bean) : null;
     }
 }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/NullPropertyPointer.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/NullPropertyPointer.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/NullPropertyPointer.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/NullPropertyPointer.java Sun Feb  3 12:19:24 2008
@@ -33,50 +33,85 @@
     private boolean byNameAttribute = false;
 
     /**
+     * Create a new NullPropertyPointer.
+     * @param parent pointer
      */
     public NullPropertyPointer(NodePointer parent) {
         super(parent);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public QName getName() {
         return new QName(propertyName);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void setPropertyIndex(int index) {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int getLength() {
         return 0;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object getBaseValue() {
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object getImmediateNode() {
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isLeaf() {
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public NodePointer getValuePointer() {
         return new NullPointer(this,  new QName(getPropertyName()));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     protected boolean isActualProperty() {
         return false;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isActual() {
         return false;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isContainer() {
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void setValue(Object value) {
         if (parent == null || parent.isContainer()) {
             throw new JXPathInvalidAccessException(
@@ -84,9 +119,9 @@
                     + asPath()
                     + ", the target object is null");
         }
-        if (parent instanceof PropertyOwnerPointer &&
-                ((PropertyOwnerPointer) parent).
-                    isDynamicPropertyDeclarationSupported()){
+        if (parent instanceof PropertyOwnerPointer
+                && ((PropertyOwnerPointer) parent)
+                        .isDynamicPropertyDeclarationSupported()) {
             // If the parent property owner can create
             // a property automatically - let it do so
             PropertyPointer propertyPointer =
@@ -102,6 +137,9 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public NodePointer createPath(JXPathContext context) {
         NodePointer newParent = parent.createPath(context);
         if (isAttribute()) {
@@ -130,6 +168,9 @@
         return newParent.createChild(context, getName(), getIndex());
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public NodePointer createPath(JXPathContext context, Object value) {
         NodePointer newParent = parent.createPath(context);
         if (isAttribute()) {
@@ -147,48 +188,68 @@
         return newParent.createChild(context, getName(), index, value);
     }
 
-    public NodePointer createChild(
-            JXPathContext context,
-            QName name,
-            int index)
-    {
+    /**
+     * {@inheritDoc}
+     */
+    public NodePointer createChild(JXPathContext context, QName name, int index) {
         return createPath(context).createChild(context, name, index);
     }
 
-    public NodePointer createChild(
-            JXPathContext context,
-            QName name,
-            int index,
-            Object value)
-    {
+    /**
+     * {@inheritDoc}
+     */
+    public NodePointer createChild(JXPathContext context, QName name,
+            int index, Object value) {
         return createPath(context).createChild(context, name, index, value);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String getPropertyName() {
         return propertyName;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void setPropertyName(String propertyName) {
         this.propertyName = propertyName;
     }
 
+    /**
+     * Set the name attribute.
+     * @param attributeValue value to set
+     */
     public void setNameAttributeValue(String attributeValue) {
         this.propertyName = attributeValue;
         byNameAttribute = true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isCollection() {
         return getIndex() != WHOLE_COLLECTION;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int getPropertyCount() {
         return 0;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String[] getPropertyNames() {
         return new String[0];
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String asPath() {
         if (!byNameAttribute) {
             return super.asPath();
@@ -204,26 +265,46 @@
         return buffer.toString();
     }
 
+    /**
+     * Return a string escaping single and double quotes.
+     * @param string string to treat
+     * @return string with any necessary changes made.
+     */
     private String escape(String string) {
-        int index = string.indexOf('\'');
-        while (index != -1) {
-            string =
-                string.substring(0, index)
-                    + "&apos;"
-                    + string.substring(index + 1);
-            index = string.indexOf('\'');
-        }
-        index = string.indexOf('\"');
-        while (index != -1) {
-            string =
-                string.substring(0, index)
-                    + "&quot;"
-                    + string.substring(index + 1);
-            index = string.indexOf('\"');
-        }
-        return string;
-    }
-
+        final char[] c = new char[] { '\'', '"' };
+        final String[] esc = new String[] { "&apos;", "&quot;" };
+        StringBuffer sb = null;
+        for (int i = 0; sb == null && i < c.length; i++) {
+            if (string.indexOf(c[i]) >= 0) {
+                sb = new StringBuffer(string);
+            }
+        }
+        if (sb == null) {
+            return string;
+        }
+        for (int i = 0; i < c.length; i++) {
+            if (string.indexOf(c[i]) < 0) {
+                continue;
+            }
+            int pos = 0;
+            while (pos < sb.length()) {
+                if (sb.charAt(pos) == c[i]) {
+                    sb.replace(pos, pos + 1, esc[i]);
+                    pos += esc[i].length();
+                }
+                else {
+                    pos++;
+                }
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Create a "bad factory" JXPathAbstractFactoryException for the specified AbstractFactory.
+     * @param factory AbstractFactory
+     * @return JXPathAbstractFactoryException
+     */
     private JXPathAbstractFactoryException createBadFactoryException(AbstractFactory factory) {
         return new JXPathAbstractFactoryException("Factory " + factory
                 + " reported success creating object for path: " + asPath()

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/DOMAttributeIterator.java Sun Feb  3 12:19:24 2008
@@ -39,6 +39,11 @@
     private List attributes;
     private int position = 0;
 
+    /**
+     * Create a new DOMAttributeIterator.
+     * @param parent pointer
+     * @param name to test
+     */
     public DOMAttributeIterator(NodePointer parent, QName name) {
         this.parent = parent;
         this.name = name;
@@ -65,6 +70,11 @@
         }
     }
 
+    /**
+     * Test an attribute.
+     * @param attr to test
+     * @return whether test succeeded
+     */
     private boolean testAttr(Attr attr) {
         String nodePrefix = DOMNodePointer.getPrefix(attr);
         String nodeLocalName = DOMNodePointer.getLocalName(attr);
@@ -93,10 +103,22 @@
         return false;
     }
 
+    /**
+     * Test whether two strings are == or .equals()
+     * @param s1 first string
+     * @param s2 second string
+     * @return boolean
+     */
     private static boolean equalStrings(String s1, String s2) {
         return s1 == s2 || s1 != null && s1.equals(s2);
     }
 
+    /**
+     * Get the named attribute.
+     * @param element to search
+     * @param name to match
+     * @return Attr found
+     */
     private Attr getAttribute(Element element, QName name) {
         String testPrefix = name.getPrefix();
         String testNS = null;
@@ -126,6 +148,9 @@
         return element.getAttributeNode(name.getName());
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public NodePointer getNodePointer() {
         if (position == 0) {
             if (!setPosition(1)) {
@@ -140,10 +165,16 @@
         return new DOMAttributePointer(parent, (Attr) attributes.get(index));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int getPosition() {
         return position;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean setPosition(int position) {
         this.position = position;
         return position >= 1 && position <= attributes.size();

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicAttributeIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicAttributeIterator.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicAttributeIterator.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicAttributeIterator.java Sun Feb  3 12:19:24 2008
@@ -30,11 +30,19 @@
  */
 public class DynamicAttributeIterator extends BeanAttributeIterator {
 
+    /**
+     * Create a new DynamicAttributeIterator.
+     * @param parent pointer
+     * @param name to match properties
+     */
     public DynamicAttributeIterator(PropertyOwnerPointer parent, QName name) {
         super(parent, name);
     }
 
-     protected void prepareForIndividualProperty(String name) {
+    /**
+     * {@inheritDoc}
+     */
+    protected void prepareForIndividualProperty(String name) {
          ((DynamicPropertyPointer) getPropertyPointer()).setPropertyName(name);
          super.prepareForIndividualProperty(name);
     }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyPointer.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyPointer.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyPointer.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyPointer.java Sun Feb  3 12:19:24 2008
@@ -44,15 +44,20 @@
     private String[] names;
     private String requiredPropertyName;
 
-    public DynamicPropertyPointer(
-            NodePointer parent,
-            DynamicPropertyHandler handler)
-    {
+    /**
+     * Create a new DynamicPropertyPointer.
+     * @param parent pointer
+     * @param handler DynamicPropertyHandler
+     */
+    public DynamicPropertyPointer(NodePointer parent,
+            DynamicPropertyHandler handler) {
         super(parent);
         this.handler = handler;
     }
+
     /**
      * This type of node is auxiliary.
+     * @return true
      */
     public boolean isContainer() {
         return true;
@@ -60,17 +65,19 @@
 
     /**
      * Number of the DP object's properties.
+     * @return int
      */
     public int getPropertyCount() {
         return getPropertyNames().length;
     }
 
     /**
-     * Names of all properties, sorted alphabetically
+     * Names of all properties, sorted alphabetically.
+     * @return String[]
      */
     public String[] getPropertyNames() {
         if (names == null) {
-            String allNames[] = handler.getPropertyNames(getBean());
+            String[] allNames = handler.getPropertyNames(getBean());
             names = new String[allNames.length];
             for (int i = 0; i < names.length; i++) {
                 names[i] = allNames[i];
@@ -93,10 +100,11 @@
     /**
      * Returns the name of the currently selected property or "*"
      * if none has been selected.
+     * @return String
      */
     public String getPropertyName() {
         if (name == null) {
-            String names[] = getPropertyNames();
+            String[] names = getPropertyNames();
             name = propertyIndex >= 0 && propertyIndex < names.length ? names[propertyIndex] : "*";
         }
         return name;
@@ -108,6 +116,7 @@
      * adds this name to the object's property name list. It does not
      * set the property value though. In order to set the property
      * value, call setValue().
+     * @param propertyName to set
      */
     public void setPropertyName(String propertyName) {
         setPropertyIndex(UNSPECIFIED_PROPERTY);
@@ -121,10 +130,11 @@
     /**
      * Index of the currently selected property in the list of all
      * properties sorted alphabetically.
+     * @return int
      */
     public int getPropertyIndex() {
         if (propertyIndex == UNSPECIFIED_PROPERTY) {
-            String names[] = getPropertyNames();
+            String[] names = getPropertyNames();
             for (int i = 0; i < names.length; i++) {
                 if (names[i].equals(name)) {
                     setPropertyIndex(i);
@@ -138,6 +148,7 @@
     /**
      * Index a property by its index in the list of all
      * properties sorted alphabetically.
+     * @param index to set
      */
     public void setPropertyIndex(int index) {
         if (propertyIndex != index) {
@@ -149,6 +160,7 @@
     /**
      * Returns the value of the property, not an element of the collection
      * represented by the property, if any.
+     * @return Object
      */
     public Object getBaseValue() {
         return handler.getProperty(getBean(), getPropertyName());
@@ -159,6 +171,7 @@
      * the value of the index'th element of the collection represented by the
      * property. If the property is not a collection, index should be zero
      * and the value will be the property itself.
+     * @return Object
      */
     public Object getImmediateNode() {
         Object value;
@@ -178,6 +191,7 @@
     /**
      * A dynamic property is always considered actual - all keys are apparently
      * existing with possibly the value of null.
+     * @return boolean
      */
     protected boolean isActualProperty() {
         return true;
@@ -187,6 +201,7 @@
      * If index == WHOLE_COLLECTION, change the value of the property, otherwise
      * change the value of the index'th element of the collection
      * represented by the property.
+     * @param value to set
      */
     public void setValue(Object value) {
         if (index == WHOLE_COLLECTION) {
@@ -200,6 +215,9 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public NodePointer createPath(JXPathContext context) {
         // Ignore the name passed to us, use our own data
         Object collection = getBaseValue();
@@ -234,6 +252,9 @@
         return this;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public NodePointer createPath(JXPathContext context, Object value) {
         if (index == WHOLE_COLLECTION) {
             handler.setProperty(getBean(), getPropertyName(), value);
@@ -245,6 +266,9 @@
         return this;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void remove() {
         if (index == WHOLE_COLLECTION) {
             removeKey();
@@ -258,6 +282,9 @@
         }
     }
 
+    /**
+     * Remove the current property.
+     */
     private void removeKey() {
         Object bean = getBean();
         if (bean instanceof Map) {
@@ -268,6 +295,9 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String asPath() {
         StringBuffer buffer = new StringBuffer();
         buffer.append(getImmediateParentPointer().asPath());
@@ -286,6 +316,11 @@
         return buffer.toString();
     }
 
+    /**
+     * Escape string.
+     * @param string s
+     * @return String
+     */
     private String escape(String string) {
         int index = string.indexOf('\'');
         while (index != -1) {
@@ -306,6 +341,11 @@
         return string;
     }
 
+    /**
+     * Get abstractFactory from context.
+     * @param context to search
+     * @return AbstractFactory
+     */
     private AbstractFactory getAbstractFactory(JXPathContext context) {
         AbstractFactory factory = context.getFactory();
         if (factory == null) {

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java Sun Feb  3 12:19:24 2008
@@ -32,14 +32,22 @@
  */
 public class ServletContextHandler implements DynamicPropertyHandler {
 
-    private static final String[] STRING_ARRAY = new String[0];
+    private static final int DEFAULT_PROPERTY_COUNT = 16;
 
+    /**
+     * {@inheritDoc}
+     */
     public String[] getPropertyNames(Object context) {
-        HashSet list = new HashSet(16);
+        HashSet list = new HashSet(DEFAULT_PROPERTY_COUNT);
         collectPropertyNames(list, context);
-        return (String[]) list.toArray(STRING_ARRAY);
+        return (String[]) list.toArray(new String[list.size()]);
     }
 
+    /**
+     * Collect the property names from bean, storing in set.
+     * @param set destination
+     * @param bean to read
+     */
     protected void collectPropertyNames(HashSet set, Object bean) {
         Enumeration e = ((ServletContext) bean).getAttributeNames();
         while (e.hasMoreElements()) {
@@ -47,10 +55,16 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object getProperty(Object context, String property) {
         return ((ServletContext) context).getAttribute(property);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void setProperty(Object context, String property, Object value) {
         ((ServletContext) context).setAttribute(property, value);
     }

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java Sun Feb  3 12:19:24 2008
@@ -24,12 +24,15 @@
  * @author Dmitri Plotnikov
  * @version $Revision$ $Date$
  */
-public class ReverseComparator implements Comparator {
+public final class ReverseComparator implements Comparator {
     /**
      * Singleton reverse comparator instance.
      */
     public static final Comparator INSTANCE = new ReverseComparator();
 
+    /**
+     * Create a new ReverseComparator.
+     */
     private ReverseComparator() {
     }
 

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java?rev=618074&r1=618073&r2=618074&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java Sun Feb  3 12:19:24 2008
@@ -45,7 +45,9 @@
     private static final int UNKNOWN_LENGTH_MAX_COUNT = 16000;
 
     /**
-     * Returns true if the object is an array or a Collection
+     * Returns true if the object is an array or a Collection.
+     * @param value to test
+     * @return boolean
      */
     public static boolean isCollection(Object value) {
         if (value == null) {
@@ -65,6 +67,8 @@
      * Returns 1 if the type is a collection,
      * -1 if it is definitely not
      * and 0 if it may be a collection in some cases.
+     * @param clazz to test
+     * @return int
      */
     public static int getCollectionHint(Class clazz) {
         if (clazz.isArray()) {
@@ -97,11 +101,12 @@
      * Otherwise, attempts to guess the length of the collection by
      * calling the indexed get method repeatedly.  The method is supposed
      * to throw an exception if the index is out of bounds.
+     * @param object collection
+     * @param pd IndexedPropertyDescriptor
+     * @return int
      */
-    public static int getIndexedPropertyLength(
-        Object object,
-        IndexedPropertyDescriptor pd)
-    {
+    public static int getIndexedPropertyLength(Object object,
+            IndexedPropertyDescriptor pd) {
         if (pd.getReadMethod() != null) {
             return getLength(getValue(object, pd));
         }
@@ -129,6 +134,8 @@
     /**
      * Returns the length of the supplied collection. If the supplied object
      * is not a collection, returns 1. If collection is null, returns 0.
+     * @param collection to check
+     * @return int
      */
     public static int getLength(Object collection) {
         if (collection == null) {
@@ -148,6 +155,8 @@
      * Returns an iterator for the supplied collection. If the argument
      * is null, returns an empty iterator. If the argument is not
      * a collection, returns an iterator that produces just that one object.
+     * @param collection to iterate
+     * @return Iterator
      */
     public static Iterator iterate(Object collection) {
         if (collection == null) {
@@ -173,11 +182,18 @@
     /**
      * Grows the collection if necessary to the specified size. Returns
      * the new, expanded collection.
+     * @param collection to expand
+     * @param size desired size
+     * @return collection or array
      */
     public static Object expandCollection(Object collection, int size) {
         if (collection == null) {
             return null;
         }
+        if (size < getLength(collection)) {
+            throw new JXPathException("adjustment of " + collection
+                    + " to size " + size + " is not an expansion");
+        }
         if (collection.getClass().isArray()) {
             Object bigger =
                 Array.newInstance(
@@ -205,13 +221,19 @@
     }
 
     /**
-     * Returns the index'th element from the supplied collection.
+     * Remove the index'th element from the supplied collection.
+     * @param collection to edit
+     * @param index int
+     * @return the resulting collection
      */
     public static Object remove(Object collection, int index) {
         collection = getValue(collection);
         if (collection == null) {
             return null;
         }
+        if (index >= getLength(collection)) {
+            throw new JXPathException("No such element at index " + index);
+        }
         if (collection.getClass().isArray()) {
             int length = Array.getLength(collection);
             Object smaller =
@@ -262,6 +284,9 @@
 
     /**
      * Returns the index'th element of the supplied collection.
+     * @param collection to read
+     * @param index int
+     * @return collection[index]
      */
     public static Object getValue(Object collection, int index) {
         collection = getValue(collection);
@@ -299,6 +324,9 @@
     /**
      * Modifies the index'th element of the supplied collection.
      * Converts the value to the required type if necessary.
+     * @param collection to edit
+     * @param index to replace
+     * @param value new value
      */
     public static void setValue(Object collection, int index, Object value) {
         collection = getValue(collection);
@@ -314,8 +342,8 @@
             }
             else if (collection instanceof Collection) {
                 throw new UnsupportedOperationException(
-                    "Cannot set value of an element of a "
-                        + collection.getClass().getName());
+                        "Cannot set value of an element of a "
+                                + collection.getClass().getName());
             }
         }
     }
@@ -323,11 +351,12 @@
     /**
      * Returns the value of the bean's property represented by
      * the supplied property descriptor.
+     * @param bean to read
+     * @param propertyDescriptor indicating what to read
+     * @return Object value
      */
-    public static Object getValue(
-        Object bean,
-        PropertyDescriptor propertyDescriptor)
-    {
+    public static Object getValue(Object bean,
+            PropertyDescriptor propertyDescriptor) {
         Object value;
         try {
             Method method =
@@ -351,12 +380,12 @@
     /**
      * Modifies the value of the bean's property represented by
      * the supplied property descriptor.
+     * @param bean to read
+     * @param propertyDescriptor indicating what to read
+     * @param value to set
      */
-    public static void setValue(
-        Object bean,
-        PropertyDescriptor propertyDescriptor,
-        Object value)
-    {
+    public static void setValue(Object bean,
+            PropertyDescriptor propertyDescriptor, Object value) {
         try {
             Method method =
                 getAccessibleMethod(propertyDescriptor.getWriteMethod());
@@ -376,6 +405,12 @@
         }
     }
 
+    /**
+     * Convert value to type.
+     * @param value Object
+     * @param type destination
+     * @return conversion result
+     */
     private static Object convert(Object value, Class type) {
         try {
             return TypeUtils.convert(value, type);
@@ -393,12 +428,13 @@
     /**
      * Returns the index'th element of the bean's property represented by
      * the supplied property descriptor.
+     * @param bean to read
+     * @param propertyDescriptor indicating what to read
+     * @param index int
+     * @return Object
      */
-    public static Object getValue(
-        Object bean,
-        PropertyDescriptor propertyDescriptor,
-        int index)
-    {
+    public static Object getValue(Object bean,
+            PropertyDescriptor propertyDescriptor, int index) {
         if (propertyDescriptor instanceof IndexedPropertyDescriptor) {
             try {
                 IndexedPropertyDescriptor ipd =
@@ -435,13 +471,13 @@
      * Modifies the index'th element of the bean's property represented by
      * the supplied property descriptor. Converts the value to the required
      * type if necessary.
+     * @param bean to edit
+     * @param propertyDescriptor indicating what to set
+     * @param index int
+     * @param value to set
      */
-    public static void setValue(
-        Object bean,
-        PropertyDescriptor propertyDescriptor,
-        int index,
-        Object value)
-    {
+    public static void setValue(Object bean,
+            PropertyDescriptor propertyDescriptor, int index, Object value) {
         if (propertyDescriptor instanceof IndexedPropertyDescriptor) {
             try {
                 IndexedPropertyDescriptor ipd =
@@ -481,6 +517,8 @@
     /**
      * If the parameter is a container, opens the container and
      * return the contents.  The method is recursive.
+     * @param object to read
+     * @return Object
      */
     public static Object getValue(Object object) {
         while (object instanceof Container) {
@@ -492,9 +530,10 @@
     /**
      * Returns a shared instance of the dynamic property handler class
      * returned by <code>getDynamicPropertyHandlerClass()</code>.
+     * @param clazz to handle
+     * @return DynamicPropertyHandler
      */
-    public static DynamicPropertyHandler getDynamicPropertyHandler(Class clazz)
-    {
+    public static DynamicPropertyHandler getDynamicPropertyHandler(Class clazz) {
         DynamicPropertyHandler handler =
             (DynamicPropertyHandler) dynamicPropertyHandlerMap.get(clazz);
         if (handler == null) {
@@ -525,6 +564,7 @@
      * can be found, return <code>null</code>.
      *
      * @param method The method that we wish to call
+     * @return Method
      */
     public static Method getAccessibleMethod(Method method) {
 
@@ -560,14 +600,12 @@
                     return clazz.getDeclaredMethod(name, parameterTypes);
                 }
                 catch (NoSuchMethodException e) {
-                    ;
                 }
             }
         }
         return null;
     }
 
-
     /**
      * Return an accessible method (that is, one that can be invoked via
      * reflection) that implements the specified method, by scanning through
@@ -577,17 +615,15 @@
      * @param clazz Parent class for the interfaces to be checked
      * @param methodName Method name of the method we wish to call
      * @param parameterTypes The parameter type signatures
+     * @return Method
      */
-    private static Method getAccessibleMethodFromInterfaceNest(
-        Class clazz,
-        String methodName,
-        Class parameterTypes[])
-    {
+    private static Method getAccessibleMethodFromInterfaceNest(Class clazz,
+            String methodName, Class[] parameterTypes) {
 
         Method method = null;
 
         // Check the implemented interfaces of the parent class
-        Class interfaces[] = clazz.getInterfaces();
+        Class[] interfaces = clazz.getInterfaces();
         for (int i = 0; i < interfaces.length; i++) {
 
             // Is this interface public?
@@ -601,7 +637,6 @@
                     interfaces[i].getDeclaredMethod(methodName, parameterTypes);
             }
             catch (NoSuchMethodException e) {
-                ;
             }
             if (method != null) {
                 break;



Mime
View raw message