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.file: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/importer/AsyncLaneSwitcherTest.java
test_class.identifier: AsyncLaneSwitcherTest
test_case.body: @Test
      public void switchSingleAsync() throws Exception{
          builder.setProperty(ASYNC_PROPERTY_NAME, "async");
  
          AsyncLaneSwitcher.switchLane(builder, "foo");
  
          PropertyState previous = builder.getProperty(AsyncLaneSwitcher.ASYNC_PREVIOUS);
          assertNotNull(previous);
          assertEquals("async", previous.getValue(Type.STRING));
      }
test_case.class_method_signature: AsyncLaneSwitcherTest.switchSingleAsync()
test_case.full_signature: @Test public void switchSingleAsync()
test_case.identifier: switchSingleAsync
test_case.invocations: setProperty switchLane getProperty assertNotNull assertEquals getValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void switchSingleAsync()
focal_class.declarator: ASYNC_PREVIOUS = "async-previous"
focal_class.modifier: static final
focal_class.original_string: static final String ASYNC_PREVIOUS = "async-previous";
focal_class.type: String
focal_class.var_name: ASYNC_PREVIOUS
focal_class.declarator: ASYNC_PREVIOUS_NONE = "none"
focal_class.modifier: static final
focal_class.original_string: static final String ASYNC_PREVIOUS_NONE = "none";
focal_class.type: String
focal_class.var_name: ASYNC_PREVIOUS_NONE
focal_class.declarator: TEMP_LANE_PREFIX = "temp-"
focal_class.modifier: private static final
focal_class.original_string: private static final String TEMP_LANE_PREFIX = "temp-";
focal_class.type: String
focal_class.var_name: TEMP_LANE_PREFIX
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/importer/AsyncLaneSwitcher.java
focal_class.identifier: AsyncLaneSwitcher
focal_class.class_method_signature: AsyncLaneSwitcher.switchLane(NodeBuilder idxBuilder, String laneName)
focal_class.full_signature: public static void switchLane(NodeBuilder idxBuilder, String laneName)
focal_class.identifier: switchLane
focal_class.modifiers: public static
focal_class.parameters: (NodeBuilder idxBuilder, String laneName)
focal_class.return: void
focal_class.signature: void switchLane(NodeBuilder idxBuilder, String laneName)
focal_class.class_method_signature: AsyncLaneSwitcher.getTempLaneName(String laneName)
focal_class.full_signature: public static String getTempLaneName(String laneName)
focal_class.identifier: getTempLaneName
focal_class.modifiers: public static
focal_class.parameters: (String laneName)
focal_class.return: String
focal_class.signature: String getTempLaneName(String laneName)
focal_class.class_method_signature: AsyncLaneSwitcher.revertSwitch(NodeBuilder idxBuilder, String indexPath)
focal_class.full_signature: public static void revertSwitch(NodeBuilder idxBuilder, String indexPath)
focal_class.identifier: revertSwitch
focal_class.modifiers: public static
focal_class.parameters: (NodeBuilder idxBuilder, String indexPath)
focal_class.return: void
focal_class.signature: void revertSwitch(NodeBuilder idxBuilder, String indexPath)
focal_class.class_method_signature: AsyncLaneSwitcher.isNone(PropertyState previousAsync)
focal_class.full_signature: public static boolean isNone(PropertyState previousAsync)
focal_class.identifier: isNone
focal_class.modifiers: public static
focal_class.parameters: (PropertyState previousAsync)
focal_class.return: boolean
focal_class.signature: boolean isNone(PropertyState previousAsync)
focal_class.class_method_signature: AsyncLaneSwitcher.clone(String newName, PropertyState currentAsyncState)
focal_class.full_signature: private static PropertyState clone(String newName, PropertyState currentAsyncState)
focal_class.identifier: clone
focal_class.modifiers: private static
focal_class.parameters: (String newName, PropertyState currentAsyncState)
focal_class.return: PropertyState
focal_class.signature: PropertyState clone(String newName, PropertyState currentAsyncState)
focal_method.body: public static void switchLane(NodeBuilder idxBuilder, String laneName) {
          PropertyState currentAsyncState = idxBuilder.getProperty(ASYNC_PROPERTY_NAME);
          PropertyState newAsyncState = PropertyStates.createProperty(ASYNC_PROPERTY_NAME, laneName, Type.STRING);
  
          if (idxBuilder.hasProperty(ASYNC_PREVIOUS)){
              //Lane already switched
              return;
          }
  
          PropertyState previousAsyncState;
          if (currentAsyncState == null) {
              previousAsyncState = PropertyStates.createProperty(ASYNC_PREVIOUS, ASYNC_PREVIOUS_NONE);
          } else {
              //Ensure that previous state is copied with correct type
              previousAsyncState = clone(ASYNC_PREVIOUS, currentAsyncState);
          }
  
          idxBuilder.setProperty(previousAsyncState);
          idxBuilder.setProperty(newAsyncState);
      }
focal_method.class_method_signature: AsyncLaneSwitcher.switchLane(NodeBuilder idxBuilder, String laneName)
focal_method.full_signature: public static void switchLane(NodeBuilder idxBuilder, String laneName)
focal_method.identifier: switchLane
focal_method.invocations: getProperty createProperty hasProperty createProperty clone setProperty setProperty
focal_method.modifiers: public static
focal_method.parameters: (NodeBuilder idxBuilder, String laneName)
focal_method.return: void
focal_method.signature: void switchLane(NodeBuilder idxBuilder, String laneName)