jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1445626 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: core/RootImpl.java query/Query.java query/QueryEngineImpl.java
Date Wed, 13 Feb 2013 14:35:00 GMT
Author: alexparvulescu
Date: Wed Feb 13 14:35:00 2013
New Revision: 1445626

URL: http://svn.apache.org/r1445626
Log:
OAK-595 Naming consistency in QueryEngine#getRootTree

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1445626&r1=1445625&r2=1445626&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
Wed Feb 13 14:35:00 2013
@@ -31,6 +31,7 @@ import org.apache.jackrabbit.oak.api.Blo
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.QueryEngine;
 import org.apache.jackrabbit.oak.api.Root;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.plugins.index.diffindex.UUIDDiffIndexProviderWrapper;
@@ -296,8 +297,8 @@ public class RootImpl implements Root {
             }
 
             @Override
-            protected Root getRootTree() {
-                return RootImpl.this;
+            protected Tree getRootTree() {
+                return rootTree;
             }
 
         };

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java?rev=1445626&r1=1445625&r2=1445626&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
Wed Feb 13 14:35:00 2013
@@ -21,8 +21,8 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.jackrabbit.oak.api.PropertyValue;
-import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.namepath.JcrPathParser;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.query.ast.AstVisitorBase;
@@ -92,7 +92,7 @@ public class Query {
     private long offset;
     private long size = -1;
     private boolean prepared;
-    private Root rootTree;
+    private Tree rootTree;
     private NodeState rootState;
     private NamePathMapper namePathMapper;
 
@@ -603,7 +603,7 @@ public class Query {
         return queryEngine.getBestIndex(this, rootState, filter);
     }
 
-    public void setRootTree(Root rootTree) {
+    public void setRootTree(Tree rootTree) {
         this.rootTree = rootTree;
     }
     
@@ -620,9 +620,12 @@ public class Query {
     }
 
     public Tree getTree(String path) {
-        return rootTree.getTree(path);
+        return rootTree
+                .getLocation()
+                .getChild(PathUtils.isAbsolute(path) ? path.substring(1) : path)
+                .getTree();
     }
-    
+
     /**
      * Validate a path is syntactically correct.
      * 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java?rev=1445626&r1=1445625&r2=1445626&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
Wed Feb 13 14:35:00 2013
@@ -25,7 +25,7 @@ import java.util.Map.Entry;
 import org.apache.jackrabbit.oak.api.PropertyValue;
 import org.apache.jackrabbit.oak.api.QueryEngine;
 import org.apache.jackrabbit.oak.api.Result;
-import org.apache.jackrabbit.oak.api.Root;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.query.index.TraversingIndex;
 import org.apache.jackrabbit.oak.spi.query.Filter;
@@ -96,20 +96,20 @@ public abstract class QueryEngineImpl im
     public QueryEngineImpl(QueryIndexProvider indexProvider) {
         this.indexProvider = indexProvider;
     }
-    
+
     /**
      * Get the current root node state, to run the query against.
      * 
      * @return the node state
      */
     protected abstract NodeState getRootState();
-    
+
     /**
      * Get the current root tree, to run the query against.
      * 
      * @return the node state
      */
-    protected abstract Root getRootTree();
+    protected abstract Tree getRootTree();
 
     @Override
     public Set<String> getSupportedQueryLanguages() {



Mime
View raw message