jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1406073 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast: ChildNodeJoinConditionImpl.java EquiJoinConditionImpl.java
Date Tue, 06 Nov 2012 08:51:52 GMT
Author: mreutegg
Date: Tue Nov  6 08:51:52 2012
New Revision: 1406073

URL: http://svn.apache.org/viewvc?rev=1406073&view=rev
Log:
OAK-423: Query: org.apache.jackrabbit.oak.spi.query.Cursor.currentRow called too late
- need this fix, otherwise tests fail with changes I have ready for OAK-388

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java?rev=1406073&r1=1406072&r2=1406073&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java
Tue Nov  6 08:51:52 2012
@@ -64,13 +64,17 @@ public class ChildNodeJoinConditionImpl 
 
     @Override
     public void restrict(FilterImpl f) {
-        String p = parentSelector.currentPath();
-        String c = childSelector.currentPath();
-        if (f.getSelector() == parentSelector && c != null) {
-            f.restrictPath(PathUtils.getParentPath(c), Filter.PathRestriction.EXACT);
+        if (f.getSelector() == parentSelector) {
+            String c = childSelector.currentPath();
+            if (c != null) {
+                f.restrictPath(PathUtils.getParentPath(c), Filter.PathRestriction.EXACT);
+            }
         }
-        if (f.getSelector() == childSelector && p != null) {
-            f.restrictPath(p, Filter.PathRestriction.DIRECT_CHILDREN);
+        if (f.getSelector() == childSelector) {
+            String p = parentSelector.currentPath();
+            if (p != null) {
+                f.restrictPath(p, Filter.PathRestriction.DIRECT_CHILDREN);
+            }
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java?rev=1406073&r1=1406072&r2=1406073&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
Tue Nov  6 08:51:52 2012
@@ -95,18 +95,22 @@ public class EquiJoinConditionImpl exten
 
     @Override
     public void restrict(FilterImpl f) {
-        PropertyValue p1 = selector1.currentProperty(property1Name);
-        PropertyValue p2 = selector2.currentProperty(property2Name);
-        if (f.getSelector() == selector1 && p2 != null) {
-            if (!p2.isArray()) {
-                // TODO support join on multi-valued properties
-                f.restrictProperty(property1Name, Operator.EQUAL, p2);
+        if (f.getSelector() == selector1) {
+            PropertyValue p2 = selector2.currentProperty(property2Name);
+            if (p2 != null) {
+                if (!p2.isArray()) {
+                    // TODO support join on multi-valued properties
+                    f.restrictProperty(property1Name, Operator.EQUAL, p2);
+                }
             }
         }
-        if (f.getSelector() == selector2 && p1 != null) {
-            if (!p1.isArray()) {
-                // TODO support join on multi-valued properties
-                f.restrictProperty(property2Name, Operator.EQUAL, p1);
+        if (f.getSelector() == selector2) {
+            PropertyValue p1 = selector1.currentProperty(property1Name);
+            if (p1 != null) {
+                if (!p1.isArray()) {
+                    // TODO support join on multi-valued properties
+                    f.restrictProperty(property2Name, Operator.EQUAL, p1);
+                }
             }
         }
     }



Mime
View raw message