test_class.declarator: builderProvider = new DocumentMKBuilderProvider()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public DocumentMKBuilderProvider builderProvider = new DocumentMKBuilderProvider();
test_class.type: DocumentMKBuilderProvider
test_class.var_name: builderProvider
test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranchTest.java
test_class.identifier: DocumentNodeStoreBranchTest
test_case.body: @Test
      public void branchedBranch() throws Exception {
          DocumentNodeStore ns = builderProvider.newBuilder().getNodeStore();
          NodeBuilder b1 = ns.getRoot().builder();
          b1.child("a");
          persistToBranch(b1);
          NodeBuilder b2 = b1.getNodeState().builder();
          b1.child("b");
          persistToBranch(b1);
  
          b2.child("c");
          persistToBranch(b2);
          assertTrue(b2.hasChildNode("a"));
          assertFalse(b2.hasChildNode("b"));
          assertTrue(b2.hasChildNode("c"));
  
          // b1 must still see 'a' and 'b', but not 'c'
          assertTrue(b1.hasChildNode("a"));
          assertTrue(b1.hasChildNode("b"));
          assertFalse(b1.hasChildNode("c"));
  
          merge(ns, b1);
  
          assertTrue(ns.getRoot().getChildNode("a").exists());
          assertTrue(ns.getRoot().getChildNode("b").exists());
          assertFalse(ns.getRoot().getChildNode("c").exists());
  
          // b2 must not be able to merge
          try {
              merge(ns, b2);
              fail("Merge must fail with IllegalStateException");
          } catch (IllegalStateException e) {
              // expected
          }
      }
test_case.class_method_signature: DocumentNodeStoreBranchTest.branchedBranch()
test_case.full_signature: @Test public void branchedBranch()
test_case.identifier: branchedBranch
test_case.invocations: getNodeStore newBuilder builder getRoot child persistToBranch builder getNodeState child persistToBranch child persistToBranch assertTrue hasChildNode assertFalse hasChildNode assertTrue hasChildNode assertTrue hasChildNode assertTrue hasChildNode assertFalse hasChildNode merge assertTrue exists getChildNode getRoot assertTrue exists getChildNode getRoot assertFalse exists getChildNode getRoot merge fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void branchedBranch()
focal_class.declarator: LOG = LoggerFactory.getLogger(DocumentNodeStoreBranch.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(DocumentNodeStoreBranch.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: perfLogger = new PerfLogger(
              LoggerFactory.getLogger(DocumentNodeStoreBranch.class.getName()
                      + ".perf"))
focal_class.modifier: private static final
focal_class.original_string: private static final PerfLogger perfLogger = new PerfLogger(
              LoggerFactory.getLogger(DocumentNodeStoreBranch.class.getName()
                      + ".perf"));
focal_class.type: PerfLogger
focal_class.var_name: perfLogger
focal_class.declarator: MAX_LOCK_TRY_TIME_MULTIPLIER = Integer.getInteger("oak.maxLockTryTimeMultiplier", 30)
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_LOCK_TRY_TIME_MULTIPLIER = Integer.getInteger("oak.maxLockTryTimeMultiplier", 30);
focal_class.type: int
focal_class.var_name: MAX_LOCK_TRY_TIME_MULTIPLIER
focal_class.declarator: RANDOM = new Random()
focal_class.modifier: private static final
focal_class.original_string: private static final Random RANDOM = new Random();
focal_class.type: Random
focal_class.var_name: RANDOM
focal_class.declarator: MIN_BACKOFF = 50
focal_class.modifier: private static final
focal_class.original_string: private static final long MIN_BACKOFF = 50;
focal_class.type: long
focal_class.var_name: MIN_BACKOFF
focal_class.declarator: store
focal_class.modifier: protected final
focal_class.original_string: protected final DocumentNodeStore store;
focal_class.type: DocumentNodeStore
focal_class.var_name: store
focal_class.declarator: maximumBackoff
focal_class.modifier: protected final
focal_class.original_string: protected final long maximumBackoff;
focal_class.type: long
focal_class.var_name: maximumBackoff
focal_class.declarator: maxLockTryTimeMS
focal_class.modifier: protected final
focal_class.original_string: protected final long maxLockTryTimeMS;
focal_class.type: long
focal_class.var_name: maxLockTryTimeMS
focal_class.declarator: mergeLock
focal_class.modifier: private final
focal_class.original_string: private final ReadWriteLock mergeLock;
focal_class.type: ReadWriteLock
focal_class.var_name: mergeLock
focal_class.declarator: updateLimit
focal_class.modifier: private final
focal_class.original_string: private final int updateLimit;
focal_class.type: int
focal_class.var_name: updateLimit
focal_class.declarator: branchState
focal_class.modifier: private
focal_class.original_string: private BranchState branchState;
focal_class.type: BranchState
focal_class.var_name: branchState
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
focal_class.identifier: DocumentNodeStoreBranch
focal_class.interfaces: implements NodeStoreBranch
focal_class.class_method_signature: DocumentNodeStoreBranch.DocumentNodeStoreBranch(DocumentNodeStore store,
                              DocumentNodeState base,
                              ReadWriteLock mergeLock)
focal_class.full_signature:   DocumentNodeStoreBranch(DocumentNodeStore store,
                              DocumentNodeState base,
                              ReadWriteLock mergeLock)
focal_class.identifier: DocumentNodeStoreBranch
focal_class.parameters: (DocumentNodeStore store,
                              DocumentNodeState base,
                              ReadWriteLock mergeLock)
focal_class.signature:  DocumentNodeStoreBranch(DocumentNodeStore store,
                              DocumentNodeState base,
                              ReadWriteLock mergeLock)
focal_class.class_method_signature: DocumentNodeStoreBranch.getBase()
focal_class.full_signature: @NotNull @Override public NodeState getBase()
focal_class.identifier: getBase
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: ()
focal_class.return: NodeState
focal_class.signature: NodeState getBase()
focal_class.class_method_signature: DocumentNodeStoreBranch.getHead()
focal_class.full_signature: @NotNull @Override public NodeState getHead()
focal_class.identifier: getHead
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: ()
focal_class.return: NodeState
focal_class.signature: NodeState getHead()
focal_class.class_method_signature: DocumentNodeStoreBranch.setRoot(NodeState newRoot)
focal_class.full_signature: @Override public void setRoot(NodeState newRoot)
focal_class.identifier: setRoot
focal_class.modifiers: @Override public
focal_class.parameters: (NodeState newRoot)
focal_class.return: void
focal_class.signature: void setRoot(NodeState newRoot)
focal_class.class_method_signature: DocumentNodeStoreBranch.merge(@NotNull CommitHook hook, @NotNull CommitInfo info)
focal_class.full_signature: @NotNull @Override public NodeState merge(@NotNull CommitHook hook, @NotNull CommitInfo info)
focal_class.identifier: merge
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull CommitHook hook, @NotNull CommitInfo info)
focal_class.return: NodeState
focal_class.signature: NodeState merge(@NotNull CommitHook hook, @NotNull CommitInfo info)
focal_class.class_method_signature: DocumentNodeStoreBranch.rebase()
focal_class.full_signature: @Override public void rebase()
focal_class.identifier: rebase
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void rebase()
focal_class.class_method_signature: DocumentNodeStoreBranch.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: DocumentNodeStoreBranch.getMergeLock()
focal_class.full_signature: @NotNull ReadWriteLock getMergeLock()
focal_class.identifier: getMergeLock
focal_class.modifiers: @NotNull
focal_class.parameters: ()
focal_class.return: ReadWriteLock
focal_class.signature: ReadWriteLock getMergeLock()
focal_class.class_method_signature: DocumentNodeStoreBranch.persist()
focal_class.full_signature:  void persist()
focal_class.identifier: persist
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void persist()
focal_class.class_method_signature: DocumentNodeStoreBranch.merge0(@NotNull CommitHook hook,
                               @NotNull CommitInfo info,
                               boolean exclusive)
focal_class.full_signature: @NotNull private NodeState merge0(@NotNull CommitHook hook,
                               @NotNull CommitInfo info,
                               boolean exclusive)
focal_class.identifier: merge0
focal_class.modifiers: @NotNull private
focal_class.parameters: (@NotNull CommitHook hook,
                               @NotNull CommitInfo info,
                               boolean exclusive)
focal_class.return: NodeState
focal_class.signature: NodeState merge0(@NotNull CommitHook hook,
                               @NotNull CommitInfo info,
                               boolean exclusive)
focal_class.class_method_signature: DocumentNodeStoreBranch.acquireMergeLock(boolean exclusive)
focal_class.full_signature: @Nullable private Lock acquireMergeLock(boolean exclusive)
focal_class.identifier: acquireMergeLock
focal_class.modifiers: @Nullable private
focal_class.parameters: (boolean exclusive)
focal_class.return: Lock
focal_class.signature: Lock acquireMergeLock(boolean exclusive)
focal_class.class_method_signature: DocumentNodeStoreBranch.persist(final @NotNull NodeState toPersist,
                                        final @NotNull DocumentNodeState base,
                                        final @NotNull CommitInfo info,
                                        final @NotNull MergeStats stats)
focal_class.full_signature: private DocumentNodeState persist(final @NotNull NodeState toPersist,
                                        final @NotNull DocumentNodeState base,
                                        final @NotNull CommitInfo info,
                                        final @NotNull MergeStats stats)
focal_class.identifier: persist
focal_class.modifiers: private
focal_class.parameters: (final @NotNull NodeState toPersist,
                                        final @NotNull DocumentNodeState base,
                                        final @NotNull CommitInfo info,
                                        final @NotNull MergeStats stats)
focal_class.return: DocumentNodeState
focal_class.signature: DocumentNodeState persist(final @NotNull NodeState toPersist,
                                        final @NotNull DocumentNodeState base,
                                        final @NotNull CommitInfo info,
                                        final @NotNull MergeStats stats)
focal_class.class_method_signature: DocumentNodeStoreBranch.persist(@NotNull Changes op,
                                        @NotNull DocumentNodeState base,
                                        @NotNull CommitInfo info)
focal_class.full_signature: private DocumentNodeState persist(@NotNull Changes op,
                                        @NotNull DocumentNodeState base,
                                        @NotNull CommitInfo info)
focal_class.identifier: persist
focal_class.modifiers: private
focal_class.parameters: (@NotNull Changes op,
                                        @NotNull DocumentNodeState base,
                                        @NotNull CommitInfo info)
focal_class.return: DocumentNodeState
focal_class.signature: DocumentNodeState persist(@NotNull Changes op,
                                        @NotNull DocumentNodeState base,
                                        @NotNull CommitInfo info)
focal_class.class_method_signature: DocumentNodeStoreBranch.mergeFailed(Throwable t)
focal_class.full_signature: private static CommitFailedException mergeFailed(Throwable t)
focal_class.identifier: mergeFailed
focal_class.modifiers: private static
focal_class.parameters: (Throwable t)
focal_class.return: CommitFailedException
focal_class.signature: CommitFailedException mergeFailed(Throwable t)
focal_method.body: @NotNull
      @Override
      public NodeState merge(@NotNull CommitHook hook, @NotNull CommitInfo info)
              throws CommitFailedException {
          try {
              return merge0(hook, info, false);
          } catch (CommitFailedException e) {
              if (!e.isOfType(MERGE)) {
                  throw e;
              }
          }
          // retry with exclusive lock, blocking other
          // concurrent writes
          return merge0(hook, info, true);
      }
focal_method.class_method_signature: DocumentNodeStoreBranch.merge(@NotNull CommitHook hook, @NotNull CommitInfo info)
focal_method.full_signature: @NotNull @Override public NodeState merge(@NotNull CommitHook hook, @NotNull CommitInfo info)
focal_method.identifier: merge
focal_method.invocations: merge0 isOfType merge0
focal_method.modifiers: @NotNull @Override public
focal_method.parameters: (@NotNull CommitHook hook, @NotNull CommitInfo info)
focal_method.return: NodeState
focal_method.signature: NodeState merge(@NotNull CommitHook hook, @NotNull CommitInfo info)