test_class.declarator: PROP_NAMES = Lists.newArrayList("jcr:primaryType", "jcr:mixinTypes")
test_class.modifier: private static final
test_class.original_string: private static final List<String> PROP_NAMES = Lists.newArrayList("jcr:primaryType", "jcr:mixinTypes");
test_class.type: List<String>
test_class.var_name: PROP_NAMES
test_class.declarator: DECL_NODE_TYPES = Lists.newArrayList("nt:unstructured", "mix:versionable")
test_class.modifier: private static final
test_class.original_string: private static final List<String> DECL_NODE_TYPES = Lists.newArrayList("nt:unstructured", "mix:versionable");
test_class.type: List<String>
test_class.var_name: DECL_NODE_TYPES
test_class.declarator: root
test_class.modifier: private
test_class.original_string: private NodeState root;
test_class.type: NodeState
test_class.var_name: root
test_class.declarator: rootBuilder
test_class.modifier: private
test_class.original_string: private NodeBuilder rootBuilder;
test_class.type: NodeBuilder
test_class.var_name: rootBuilder
test_class.declarator: HOOK = new EditorHook(
              new IndexUpdateProvider(new PropertyIndexEditorProvider()))
test_class.modifier: private static final
test_class.original_string: private static final EditorHook HOOK = new EditorHook(
              new IndexUpdateProvider(new PropertyIndexEditorProvider()));
test_class.type: EditorHook
test_class.var_name: HOOK
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookupTest.java
test_class.identifier: PropertyIndexLookupTest
test_case.body: @Test
      public void getIndexNodeForStringPropertyNames() throws Exception {
          rootBuilder.child(INDEX_DEFINITIONS_NAME).child("nodetype")
                  .removeProperty(PROPERTY_NAMES)
                  .setProperty(PropertyStates.createProperty(PROPERTY_NAMES, PROP_NAMES, STRINGS));
          commit();
  
          Filter f = createFilter(root, "nt:unstructured");
          assertNotNull("propertyNames with String[] should also find index node",
                  new PropertyIndexLookup(root).getIndexNode(root, JCR_PRIMARYTYPE, f));
      }
test_case.class_method_signature: PropertyIndexLookupTest.getIndexNodeForStringPropertyNames()
test_case.full_signature: @Test public void getIndexNodeForStringPropertyNames()
test_case.identifier: getIndexNodeForStringPropertyNames
test_case.invocations: setProperty removeProperty child child createProperty commit createFilter assertNotNull getIndexNode
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getIndexNodeForStringPropertyNames()
focal_class.declarator: LOG = LoggerFactory.getLogger(PropertyIndexLookup.class)
focal_class.modifier: static final
focal_class.original_string: static final Logger LOG = LoggerFactory.getLogger(PropertyIndexLookup.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: COST_OVERHEAD = 2
focal_class.modifier: public static final
focal_class.original_string: public static final double COST_OVERHEAD = 2;
focal_class.type: double
focal_class.var_name: COST_OVERHEAD
focal_class.declarator: MAX_COST = 100
focal_class.modifier: static final
focal_class.original_string: static final int MAX_COST = 100;
focal_class.type: int
focal_class.var_name: MAX_COST
focal_class.declarator: root
focal_class.modifier: private final
focal_class.original_string: private final NodeState root;
focal_class.type: NodeState
focal_class.var_name: root
focal_class.declarator: mountInfoProvider
focal_class.modifier: private final
focal_class.original_string: private final MountInfoProvider mountInfoProvider;
focal_class.type: MountInfoProvider
focal_class.var_name: mountInfoProvider
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
focal_class.identifier: PropertyIndexLookup
focal_class.class_method_signature: PropertyIndexLookup.PropertyIndexLookup(NodeState root)
focal_class.full_signature: public  PropertyIndexLookup(NodeState root)
focal_class.identifier: PropertyIndexLookup
focal_class.modifiers: public
focal_class.parameters: (NodeState root)
focal_class.signature:  PropertyIndexLookup(NodeState root)
focal_class.class_method_signature: PropertyIndexLookup.PropertyIndexLookup(NodeState root, MountInfoProvider mountInfoProvider)
focal_class.full_signature: public  PropertyIndexLookup(NodeState root, MountInfoProvider mountInfoProvider)
focal_class.identifier: PropertyIndexLookup
focal_class.modifiers: public
focal_class.parameters: (NodeState root, MountInfoProvider mountInfoProvider)
focal_class.signature:  PropertyIndexLookup(NodeState root, MountInfoProvider mountInfoProvider)
focal_class.class_method_signature: PropertyIndexLookup.isIndexed(String propertyName, String path, Filter filter)
focal_class.full_signature: public boolean isIndexed(String propertyName, String path, Filter filter)
focal_class.identifier: isIndexed
focal_class.modifiers: public
focal_class.parameters: (String propertyName, String path, Filter filter)
focal_class.return: boolean
focal_class.signature: boolean isIndexed(String propertyName, String path, Filter filter)
focal_class.class_method_signature: PropertyIndexLookup.query(Filter filter, String propertyName,
              PropertyValue value)
focal_class.full_signature: public Iterable<String> query(Filter filter, String propertyName,
              PropertyValue value)
focal_class.identifier: query
focal_class.modifiers: public
focal_class.parameters: (Filter filter, String propertyName,
              PropertyValue value)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> query(Filter filter, String propertyName,
              PropertyValue value)
focal_class.class_method_signature: PropertyIndexLookup.getStrategies(NodeState definition)
focal_class.full_signature:  Set<IndexStoreStrategy> getStrategies(NodeState definition)
focal_class.identifier: getStrategies
focal_class.parameters: (NodeState definition)
focal_class.return: Set<IndexStoreStrategy>
focal_class.signature: Set<IndexStoreStrategy> getStrategies(NodeState definition)
focal_class.class_method_signature: PropertyIndexLookup.getCost(Filter filter, String propertyName, PropertyValue value)
focal_class.full_signature: public double getCost(Filter filter, String propertyName, PropertyValue value)
focal_class.identifier: getCost
focal_class.modifiers: public
focal_class.parameters: (Filter filter, String propertyName, PropertyValue value)
focal_class.return: double
focal_class.signature: double getCost(Filter filter, String propertyName, PropertyValue value)
focal_class.class_method_signature: PropertyIndexLookup.getIndexNode(NodeState node, String propertyName, Filter filter)
focal_class.full_signature: @Nullable NodeState getIndexNode(NodeState node, String propertyName, Filter filter)
focal_class.identifier: getIndexNode
focal_class.modifiers: @Nullable
focal_class.parameters: (NodeState node, String propertyName, Filter filter)
focal_class.return: NodeState
focal_class.signature: NodeState getIndexNode(NodeState node, String propertyName, Filter filter)
focal_class.class_method_signature: PropertyIndexLookup.getType()
focal_class.full_signature:  String getType()
focal_class.identifier: getType
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getType()
focal_class.class_method_signature: PropertyIndexLookup.getSuperTypes(Filter filter)
focal_class.full_signature: @Nullable private static Set<String> getSuperTypes(Filter filter)
focal_class.identifier: getSuperTypes
focal_class.modifiers: @Nullable private static
focal_class.parameters: (Filter filter)
focal_class.return: Set<String>
focal_class.signature: Set<String> getSuperTypes(Filter filter)
focal_class.class_method_signature: PropertyIndexLookup.getNames(@NotNull NodeState state, @NotNull String propertyName)
focal_class.full_signature: @NotNull private static Iterable<String> getNames(@NotNull NodeState state, @NotNull String propertyName)
focal_class.identifier: getNames
focal_class.modifiers: @NotNull private static
focal_class.parameters: (@NotNull NodeState state, @NotNull String propertyName)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> getNames(@NotNull NodeState state, @NotNull String propertyName)
focal_method.body: @Nullable
      NodeState getIndexNode(NodeState node, String propertyName, Filter filter) {
          // keep a fallback to a matching index def that has *no* node type constraints
          // (initially, there is no fallback)
          NodeState fallback = null;
  
          NodeState state = node.getChildNode(INDEX_DEFINITIONS_NAME);
          for (ChildNodeEntry entry : state.getChildNodeEntries()) {
              NodeState index = entry.getNodeState();
              PropertyState type = index.getProperty(TYPE_PROPERTY_NAME);
              if (type == null || type.isArray() || !getType().equals(type.getValue(Type.STRING))) {
                  continue;
              }
              if (contains(getNames(index, PROPERTY_NAMES), propertyName)) {
                  NodeState indexContent = index.getChildNode(INDEX_CONTENT_NODE_NAME);
                  if (!indexContent.exists()) {
                      continue;
                  }
                  Set<String> supertypes = getSuperTypes(filter);
                  if (index.hasProperty(DECLARING_NODE_TYPES)) {
                      if (supertypes != null) {
                          for (String typeName : getNames(index, DECLARING_NODE_TYPES)) {
                              if (supertypes.contains(typeName)) {
                                  // TODO: prefer the most specific type restriction
                                  return index;
                              }
                          }
                      }
                  } else if (supertypes == null) {
                      return index;
                  } else if (fallback == null) {
                      // update the fallback
                      fallback = index;
                  }
              }
          }
          return fallback;
      }
focal_method.class_method_signature: PropertyIndexLookup.getIndexNode(NodeState node, String propertyName, Filter filter)
focal_method.full_signature: @Nullable NodeState getIndexNode(NodeState node, String propertyName, Filter filter)
focal_method.identifier: getIndexNode
focal_method.invocations: getChildNode getChildNodeEntries getNodeState getProperty isArray equals getType getValue contains getNames getChildNode exists getSuperTypes hasProperty getNames contains
focal_method.modifiers: @Nullable
focal_method.parameters: (NodeState node, String propertyName, Filter filter)
focal_method.return: NodeState
focal_method.signature: NodeState getIndexNode(NodeState node, String propertyName, Filter filter)