jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1406089 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast: DescendantNodeJoinConditionImpl.java SameNodeJoinConditionImpl.java
Date Tue, 06 Nov 2012 10:45:43 GMT
Author: mreutegg
Date: Tue Nov  6 10:45:43 2012
New Revision: 1406089

URL: http://svn.apache.org/viewvc?rev=1406089&view=rev
Log:
OAK-423: Query: org.apache.jackrabbit.oak.spi.query.Cursor.currentRow called too late
- Fixed in two more places (DescendantNodeJoinConditionImpl and SameNodeJoinConditionImpl)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java?rev=1406089&r1=1406088&r2=1406089&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java
Tue Nov  6 10:45:43 2012
@@ -64,13 +64,17 @@ public class DescendantNodeJoinCondition
 
     @Override
     public void restrict(FilterImpl f) {
-        String d = descendantSelector.currentPath();
-        String a = ancestorSelector.currentPath();
-        if (d != null && f.getSelector() == ancestorSelector) {
-            f.restrictPath(PathUtils.getParentPath(d), Filter.PathRestriction.PARENT);
+        if (f.getSelector() == ancestorSelector) {
+            String d = descendantSelector.currentPath();
+            if (d != null) {
+                f.restrictPath(PathUtils.getParentPath(d), Filter.PathRestriction.PARENT);
+            }
         }
-        if (a != null && f.getSelector() == descendantSelector) {
-            f.restrictPath(a, Filter.PathRestriction.DIRECT_CHILDREN);
+        if (f.getSelector() == descendantSelector) {
+            String a = ancestorSelector.currentPath();
+            if (a != null) {
+                f.restrictPath(a, Filter.PathRestriction.DIRECT_CHILDREN);
+            }
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java?rev=1406089&r1=1406088&r2=1406089&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java
Tue Nov  6 10:45:43 2012
@@ -73,12 +73,12 @@ public class SameNodeJoinConditionImpl e
 
     @Override
     public void restrict(FilterImpl f) {
-        String p1 = selector1.currentPath();
-        String p2 = selector2.currentPath();
         if (f.getSelector() == selector1) {
+            String p2 = selector2.currentPath();
             f.restrictPath(p2, Filter.PathRestriction.EXACT);
         }
         if (f.getSelector() == selector2) {
+            String p1 = selector1.currentPath();
             f.restrictPath(p1, Filter.PathRestriction.EXACT);
         }
     }



Mime
View raw message