You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mb...@apache.org on 2007/07/11 00:16:03 UTC

svn commit: r555098 - /jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java

Author: mbenson
Date: Tue Jul 10 15:16:02 2007
New Revision: 555098

URL: http://svn.apache.org/viewvc?view=rev&rev=555098
Log:
small refactoring

Modified:
    jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java

Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java?view=diff&rev=555098&r1=555097&r2=555098
==============================================================================
--- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java (original)
+++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationCompare.java Tue Jul 10 15:16:02 2007
@@ -50,10 +50,6 @@
         Object l = left.compute(context);
         Object r = right.compute(context);
 
-//        System.err.println("COMPARING: " +
-//            (l == null ? "null" : l.getClass().getName()) + " " +
-//            (r == null ? "null" : r.getClass().getName()));
-
         if (l instanceof InitialContext) {
             ((EvalContext) l).reset();
         }
@@ -78,15 +74,15 @@
             r = ((Collection) r).iterator();
         }
 
-        if ((l instanceof Iterator) && !(r instanceof Iterator)) {
+        if (l instanceof Iterator && r instanceof Iterator) {
+            return findMatch((Iterator) l, (Iterator) r);
+        }
+        if (l instanceof Iterator) {
             return contains((Iterator) l, r);
         }
-        if (!(l instanceof Iterator) && (r instanceof Iterator)) {
+        if (r instanceof Iterator) {
             return contains((Iterator) r, l);
         }
-        if (l instanceof Iterator && r instanceof Iterator) {
-            return findMatch((Iterator) l, (Iterator) r);
-        }
         return equal(l, r);
     }
 
@@ -132,7 +128,6 @@
             return true;
         }
 
-//        System.err.println("COMPARING VALUES: " + l + " " + r);
         if (l instanceof Boolean || r instanceof Boolean) {
             return (InfoSetUtil.booleanValue(l) == InfoSetUtil.booleanValue(r));
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org