commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmi...@apache.org
Subject svn commit: r329513 - in /jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri: axes/UnionContext.java compiler/ExpressionPath.java compiler/Path.java
Date Sun, 30 Oct 2005 03:07:16 GMT
Author: dmitri
Date: Sat Oct 29 20:07:12 2005
New Revision: 329513

URL: http://svn.apache.org/viewcvs?rev=329513&view=rev
Log:
Corrected behavior of chained predicates.  
Each predicate is supposed to form its own node set.

Modified:
    jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/UnionContext.java
    jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/ExpressionPath.java
    jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/Path.java

Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/UnionContext.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/UnionContext.java?rev=329513&r1=329512&r2=329513&view=diff
==============================================================================
--- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/UnionContext.java
(original)
+++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/UnionContext.java
Sat Oct 29 20:07:12 2005
@@ -29,7 +29,6 @@
  * @version $Revision$ $Date$
  */
 public class UnionContext extends NodeSetContext {
-    private boolean startedSet = false;
     private EvalContext contexts[];
     private boolean prepared = false;
 

Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/ExpressionPath.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/ExpressionPath.java?rev=329513&r1=329512&r2=329513&view=diff
==============================================================================
--- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/ExpressionPath.java
(original)
+++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/ExpressionPath.java
Sat Oct 29 20:07:12 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.commons.jxpath.ri.compiler;
 
+import org.apache.commons.jxpath.BasicNodeSet;
 import org.apache.commons.jxpath.ri.EvalContext;
 import org.apache.commons.jxpath.ri.axes.InitialContext;
 import org.apache.commons.jxpath.ri.axes.NodeSetContext;
@@ -173,6 +174,9 @@
         }
         if (predicates != null) {
             for (int j = 0; j < predicates.length; j++) {
+                if (j != 0) {
+                    context = new UnionContext(context, new EvalContext[]{context});
+                }
                 context = new PredicateContext(context, predicates[j]);
             }
         }

Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/Path.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/Path.java?rev=329513&r1=329512&r2=329513&view=diff
==============================================================================
--- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/Path.java
(original)
+++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/Path.java
Sat Oct 29 20:07:12 2005
@@ -30,6 +30,7 @@
 import org.apache.commons.jxpath.ri.axes.PredicateContext;
 import org.apache.commons.jxpath.ri.axes.SelfContext;
 import org.apache.commons.jxpath.ri.axes.SimplePathInterpreter;
+import org.apache.commons.jxpath.ri.axes.UnionContext;
 import org.apache.commons.jxpath.ri.model.NodePointer;
 
 /**
@@ -238,6 +239,9 @@
             Expression predicates[] = steps[i].getPredicates();
             if (predicates != null) {
                 for (int j = 0; j < predicates.length; j++) {
+                    if (j != 0) {
+                        context = new UnionContext(context, new EvalContext[]{context});
+                    }
                     context = new PredicateContext(context, predicates[j]);
                 }
             }



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


Mime
View raw message