You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ju...@apache.org on 2013/04/24 11:12:04 UTC

svn commit: r1471310 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexHook.java

Author: jukka
Date: Wed Apr 24 09:12:03 2013
New Revision: 1471310

URL: http://svn.apache.org/r1471310
Log:
OAK-325: QueryEngine can't handle node type hierarchies

Fix type handling when reindexing

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexHook.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexHook.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexHook.java?rev=1471310&r1=1471309&r2=1471310&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexHook.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/p2/Property2IndexHook.java Wed Apr 24 09:12:03 2013
@@ -101,31 +101,36 @@ class Property2IndexHook implements Inde
     private final Map<String, List<Property2IndexHookUpdate>> indexMap;
 
     /**
+     * The root node state.
+     */
+    private final NodeState root;
+
+    /**
      * The {@code /jcr:system/jcr:nodeTypes} subtree.
      */
     private final NodeState types;
 
     public Property2IndexHook(NodeBuilder builder, NodeState root) {
         this(null, builder, null, "/",
-                new HashMap<String, List<Property2IndexHookUpdate>>(),
-                root.getChildNode(JCR_SYSTEM).getChildNode(JCR_NODE_TYPES));
+                new HashMap<String, List<Property2IndexHookUpdate>>(), root);
     }
 
     private Property2IndexHook(Property2IndexHook parent, String nodeName) {
         this(parent, getChildNode(parent.node, nodeName), nodeName, null,
-                parent.indexMap, parent.types);
+                parent.indexMap, parent.root);
     }
 
     private Property2IndexHook(Property2IndexHook parent, NodeBuilder node,
             String nodeName, String path,
             Map<String, List<Property2IndexHookUpdate>> indexMap,
-            NodeState types) {
+            NodeState root) {
         this.parent = parent;
         this.node = node;
         this.nodeName = nodeName;
         this.path = path;
         this.indexMap = indexMap;
-        this.types = types;
+        this.root = root;
+        this.types = root.getChildNode(JCR_SYSTEM).getChildNode(JCR_NODE_TYPES);
     }
 
     private static NodeBuilder getChildNode(NodeBuilder node, String name) {
@@ -303,7 +308,7 @@ class Property2IndexHook implements Inde
             }
         }
         if (reindex) {
-            return new Property2IndexHook(node, types);
+            return new Property2IndexHook(node, root);
         }
         return null;
     }