test_class.declarator: builder = EMPTY_NODE.builder()
test_class.modifier: private
test_class.original_string: private NodeBuilder builder = EMPTY_NODE.builder();
test_class.type: NodeBuilder
test_class.var_name: builder
test_class.declarator: rootBuilder = EMPTY_NODE.builder()
test_class.modifier: private
test_class.original_string: private NodeBuilder rootBuilder = EMPTY_NODE.builder();
test_class.type: NodeBuilder
test_class.var_name: rootBuilder
test_class.declarator: disabler = new IndexDisabler(rootBuilder)
test_class.modifier: private
test_class.original_string: private IndexDisabler disabler = new IndexDisabler(rootBuilder);
test_class.type: IndexDisabler
test_class.var_name: disabler
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/upgrade/IndexDisablerTest.java
test_class.identifier: IndexDisablerTest
test_case.body: @Test
      public void nodeTypeIndexDisabling_noop() throws Exception{
          builder.setProperty(IndexConstants.DISABLE_INDEXES_ON_NEXT_CYCLE, true);
          builder.setProperty(IndexConstants.SUPERSEDED_INDEX_PATHS,
                  asList("/oak:index/fooIndex/@bar"), Type.STRINGS);
  
          refreshBuilder();
  
          List<String> disabledIndexes = disabler.disableOldIndexes("/oak:index/foo", builder);
          assertTrue(disabledIndexes.isEmpty());
      }
test_case.class_method_signature: IndexDisablerTest.nodeTypeIndexDisabling_noop()
test_case.full_signature: @Test public void nodeTypeIndexDisabling_noop()
test_case.identifier: nodeTypeIndexDisabling_noop
test_case.invocations: setProperty setProperty asList refreshBuilder disableOldIndexes assertTrue isEmpty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void nodeTypeIndexDisabling_noop()
focal_class.declarator: log = LoggerFactory.getLogger(IndexDisabler.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(IndexDisabler.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: rootBuilder
focal_class.modifier: private final
focal_class.original_string: private final NodeBuilder rootBuilder;
focal_class.type: NodeBuilder
focal_class.var_name: rootBuilder
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/upgrade/IndexDisabler.java
focal_class.identifier: IndexDisabler
focal_class.class_method_signature: IndexDisabler.IndexDisabler(NodeBuilder rootBuilder)
focal_class.full_signature: public  IndexDisabler(NodeBuilder rootBuilder)
focal_class.identifier: IndexDisabler
focal_class.modifiers: public
focal_class.parameters: (NodeBuilder rootBuilder)
focal_class.signature:  IndexDisabler(NodeBuilder rootBuilder)
focal_class.class_method_signature: IndexDisabler.markDisableFlagIfRequired(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.full_signature: public boolean markDisableFlagIfRequired(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.identifier: markDisableFlagIfRequired
focal_class.modifiers: public
focal_class.parameters: (String currentIndexPath, NodeBuilder idxBuilder)
focal_class.return: boolean
focal_class.signature: boolean markDisableFlagIfRequired(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.class_method_signature: IndexDisabler.isAnyIndexToBeDisabled(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.full_signature: private boolean isAnyIndexToBeDisabled(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.identifier: isAnyIndexToBeDisabled
focal_class.modifiers: private
focal_class.parameters: (String currentIndexPath, NodeBuilder idxBuilder)
focal_class.return: boolean
focal_class.signature: boolean isAnyIndexToBeDisabled(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.class_method_signature: IndexDisabler.disableOldIndexes(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.full_signature: public List<String> disableOldIndexes(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.identifier: disableOldIndexes
focal_class.modifiers: public
focal_class.parameters: (String currentIndexPath, NodeBuilder idxBuilder)
focal_class.return: List<String>
focal_class.signature: List<String> disableOldIndexes(String currentIndexPath, NodeBuilder idxBuilder)
focal_class.class_method_signature: IndexDisabler.isNodeTypePath(String indexPath)
focal_class.full_signature: private static boolean isNodeTypePath(String indexPath)
focal_class.identifier: isNodeTypePath
focal_class.modifiers: private static
focal_class.parameters: (String indexPath)
focal_class.return: boolean
focal_class.signature: boolean isNodeTypePath(String indexPath)
focal_class.class_method_signature: IndexDisabler.child(NodeBuilder nb, String path)
focal_class.full_signature: private static NodeBuilder child(NodeBuilder nb, String path)
focal_class.identifier: child
focal_class.modifiers: private static
focal_class.parameters: (NodeBuilder nb, String path)
focal_class.return: NodeBuilder
focal_class.signature: NodeBuilder child(NodeBuilder nb, String path)
focal_method.body: public List<String> disableOldIndexes(String currentIndexPath, NodeBuilder idxBuilder) {
          PropertyState indexPathsProp = idxBuilder.getProperty(SUPERSEDED_INDEX_PATHS);
  
          if (indexPathsProp == null) {
              return emptyList();
          }
  
          if (!idxBuilder.getBoolean(DISABLE_INDEXES_ON_NEXT_CYCLE)) {
              return emptyList();
          }
  
          //Skip disabling for the cycle where reindexing just got completed
          //i.e. baseState should not have DISABLE_INDEXES_ON_NEXT_CYCLE set to false
          if (!idxBuilder.getBaseState().getBoolean(DISABLE_INDEXES_ON_NEXT_CYCLE)){
              return emptyList();
          }
  
          Iterable<String> indexPaths = indexPathsProp.getValue(Type.STRINGS);
          List<String> disabledIndexes = new ArrayList<>();
          for (final String indexPath : indexPaths) {
              if (isNodeTypePath(indexPath)) {
                  String nodeTypeName = PathUtils.getName(indexPath).substring(1);
                  String nodeTypeIndexPath = PathUtils.getParentPath(indexPath);
  
                  NodeBuilder nodeTypeIndexBuilder = child(rootBuilder, nodeTypeIndexPath);
                  PropertyState declaringNodeTypes = nodeTypeIndexBuilder.getProperty(DECLARING_NODE_TYPES);
                  if (nodeTypeIndexBuilder.exists() && declaringNodeTypes != null){
                      Set<String> existingTypes = Sets.newHashSet(declaringNodeTypes.getValue(Type.NAMES));
                      if (existingTypes.remove(nodeTypeName)) {
                          disabledIndexes.add(indexPath);
                          nodeTypeIndexBuilder.setProperty(DECLARING_NODE_TYPES, existingTypes, Type.NAMES);
                      }
                  }
              } else {
                  NodeBuilder disabledIndexBuilder = child(rootBuilder, indexPath);
                  if (disabledIndexBuilder.exists()) {
                      disabledIndexBuilder.setProperty(TYPE_PROPERTY_NAME, TYPE_DISABLED);
                      disabledIndexes.add(indexPath);
                  }
              }
          }
  
          if (!disabledIndexes.isEmpty()) {
              log.info("Index at [{}] supersedes indexes {}. Marking those as disabled",
                      currentIndexPath, disabledIndexes);
              idxBuilder.removeProperty(DISABLE_INDEXES_ON_NEXT_CYCLE);
          }
  
          return disabledIndexes;
      }
focal_method.class_method_signature: IndexDisabler.disableOldIndexes(String currentIndexPath, NodeBuilder idxBuilder)
focal_method.full_signature: public List<String> disableOldIndexes(String currentIndexPath, NodeBuilder idxBuilder)
focal_method.identifier: disableOldIndexes
focal_method.invocations: getProperty emptyList getBoolean emptyList getBoolean getBaseState emptyList getValue isNodeTypePath substring getName getParentPath child getProperty exists newHashSet getValue remove add setProperty child exists setProperty add isEmpty info removeProperty
focal_method.modifiers: public
focal_method.parameters: (String currentIndexPath, NodeBuilder idxBuilder)
focal_method.return: List<String>
focal_method.signature: List<String> disableOldIndexes(String currentIndexPath, NodeBuilder idxBuilder)