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.declarator: COUNTER = new AtomicInteger()
test_class.modifier: private static final
test_class.original_string: private static final AtomicInteger COUNTER = new AtomicInteger();
test_class.type: AtomicInteger
test_class.var_name: COUNTER
test_class.declarator: clock
test_class.modifier: private
test_class.original_string: private Clock clock;
test_class.type: Clock
test_class.var_name: clock
test_class.declarator: branches = new ArrayList<>()
test_class.modifier: private
test_class.original_string: private List<Object> branches = new ArrayList<>();
test_class.type: List<Object>
test_class.var_name: branches
test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/CollisionTest.java
test_class.identifier: CollisionTest
test_case.body: @Test
      public void isConflicting() throws CommitFailedException {
          DocumentNodeStore ns = newBuilder()
                  .setAsyncDelay(0).getNodeStore();
          DocumentStore store = ns.getDocumentStore();
          String id = Utils.getIdFromPath("/test");
  
          NodeBuilder b = ns.getRoot().builder();
          b.child("test").setProperty("p", "a");
          // test:{p:"a"}
          Revision r1 = merge(ns, b).getRevision(ns.getClusterId());
          assertNotNull(r1);
  
          NodeDocument doc = getDocument(store, id);
          // concurrent create
          Revision c = ns.newRevision();
          UpdateOp op = new UpdateOp(id, true);
          NodeDocument.setDeleted(op, c, false);
          Collision col = newCollision(doc, r1, op, c, ns);
          assertTrue(col.isConflicting());
          // concurrent change
          op = new UpdateOp(id, false);
          op.setMapEntry("p", c, "b");
          col = newCollision(doc, r1, op, c, ns);
          assertTrue(col.isConflicting());
  
          b = ns.getRoot().builder();
          b.child("test").setProperty("p", "b");
          // test:{p:"b"}
          Revision r2 = merge(ns, b).getRevision(ns.getClusterId());
          assertNotNull(r2);
  
          doc = getDocument(store, id);
          // concurrent delete
          c = ns.newRevision();
          op = new UpdateOp(id, false);
          op.setDelete(true);
          NodeDocument.setDeleted(op, c, true);
          col = newCollision(doc, r2, op, c, ns);
          assertTrue(col.isConflicting());
          // concurrent conflicting property set
          op = new UpdateOp(id, false);
          op.setMapEntry("p", c, "c");
          col = newCollision(doc, r2, op, c, ns);
          assertTrue(col.isConflicting());
          // concurrent non-conflicting property set
          op = new UpdateOp(id, false);
          op.setMapEntry("q", c, "a");
          col = newCollision(doc, r2, op, c, ns);
          assertFalse(col.isConflicting());
  
          b = ns.getRoot().builder();
          b.child("test").remove();
          // test (removed)
          Revision r3 = merge(ns, b).getRevision(ns.getClusterId());
          assertNotNull(r3);
  
          doc = getDocument(store, id);
          // concurrent delete
          c = ns.newRevision();
          op = new UpdateOp(id, false);
          op.setDelete(true);
          NodeDocument.setDeleted(op, c, true);
          col = newCollision(doc, r3, op, c, ns);
          assertTrue(col.isConflicting());
          // concurrent conflicting property set
          op = new UpdateOp(id, false);
          op.setMapEntry("p", c, "d");
          col = newCollision(doc, r3, op, c, ns);
          assertTrue(col.isConflicting());
      }
test_case.class_method_signature: CollisionTest.isConflicting()
test_case.full_signature: @Test public void isConflicting()
test_case.identifier: isConflicting
test_case.invocations: getNodeStore setAsyncDelay newBuilder getDocumentStore getIdFromPath builder getRoot setProperty child getRevision merge getClusterId assertNotNull getDocument newRevision setDeleted newCollision assertTrue isConflicting setMapEntry newCollision assertTrue isConflicting builder getRoot setProperty child getRevision merge getClusterId assertNotNull getDocument newRevision setDelete setDeleted newCollision assertTrue isConflicting setMapEntry newCollision assertTrue isConflicting setMapEntry newCollision assertFalse isConflicting builder getRoot remove child getRevision merge getClusterId assertNotNull getDocument newRevision setDelete setDeleted newCollision assertTrue isConflicting setMapEntry newCollision assertTrue isConflicting
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void isConflicting()
focal_class.declarator: LOG = LoggerFactory.getLogger(Collision.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(Collision.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: document
focal_class.modifier: private final
focal_class.original_string: private final NodeDocument document;
focal_class.type: NodeDocument
focal_class.var_name: document
focal_class.declarator: theirRev
focal_class.modifier: private final
focal_class.original_string: private final Revision theirRev;
focal_class.type: Revision
focal_class.var_name: theirRev
focal_class.declarator: ourOp
focal_class.modifier: private final
focal_class.original_string: private final UpdateOp ourOp;
focal_class.type: UpdateOp
focal_class.var_name: ourOp
focal_class.declarator: ourRev
focal_class.modifier: private final
focal_class.original_string: private final Revision ourRev;
focal_class.type: Revision
focal_class.var_name: ourRev
focal_class.declarator: context
focal_class.modifier: private final
focal_class.original_string: private final RevisionContext context;
focal_class.type: RevisionContext
focal_class.var_name: context
focal_class.declarator: startRevisions
focal_class.modifier: private final
focal_class.original_string: private final RevisionVector startRevisions;
focal_class.type: RevisionVector
focal_class.var_name: startRevisions
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/Collision.java
focal_class.identifier: Collision
focal_class.class_method_signature: Collision.Collision(@NotNull NodeDocument document,
                @NotNull Revision theirRev,
                @NotNull UpdateOp ourOp,
                @NotNull Revision ourRev,
                @NotNull RevisionContext context,
                @NotNull RevisionVector startRevisions)
focal_class.full_signature:   Collision(@NotNull NodeDocument document,
                @NotNull Revision theirRev,
                @NotNull UpdateOp ourOp,
                @NotNull Revision ourRev,
                @NotNull RevisionContext context,
                @NotNull RevisionVector startRevisions)
focal_class.identifier: Collision
focal_class.parameters: (@NotNull NodeDocument document,
                @NotNull Revision theirRev,
                @NotNull UpdateOp ourOp,
                @NotNull Revision ourRev,
                @NotNull RevisionContext context,
                @NotNull RevisionVector startRevisions)
focal_class.signature:  Collision(@NotNull NodeDocument document,
                @NotNull Revision theirRev,
                @NotNull UpdateOp ourOp,
                @NotNull Revision ourRev,
                @NotNull RevisionContext context,
                @NotNull RevisionVector startRevisions)
focal_class.class_method_signature: Collision.mark(DocumentStore store)
focal_class.full_signature: @NotNull Revision mark(DocumentStore store)
focal_class.identifier: mark
focal_class.modifiers: @NotNull
focal_class.parameters: (DocumentStore store)
focal_class.return: Revision
focal_class.signature: Revision mark(DocumentStore store)
focal_class.class_method_signature: Collision.isConflicting()
focal_class.full_signature:  boolean isConflicting()
focal_class.identifier: isConflicting
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isConflicting()
focal_class.class_method_signature: Collision.markCommitRoot(@NotNull NodeDocument document,
                                            @NotNull Revision revision,
                                            @NotNull Revision other,
                                            @NotNull DocumentStore store,
                                            @NotNull RevisionContext context)
focal_class.full_signature: private static boolean markCommitRoot(@NotNull NodeDocument document,
                                            @NotNull Revision revision,
                                            @NotNull Revision other,
                                            @NotNull DocumentStore store,
                                            @NotNull RevisionContext context)
focal_class.identifier: markCommitRoot
focal_class.modifiers: private static
focal_class.parameters: (@NotNull NodeDocument document,
                                            @NotNull Revision revision,
                                            @NotNull Revision other,
                                            @NotNull DocumentStore store,
                                            @NotNull RevisionContext context)
focal_class.return: boolean
focal_class.signature: boolean markCommitRoot(@NotNull NodeDocument document,
                                            @NotNull Revision revision,
                                            @NotNull Revision other,
                                            @NotNull DocumentStore store,
                                            @NotNull RevisionContext context)
focal_class.class_method_signature: Collision.throwNoCommitRootException(@NotNull Revision revision,
                                                     @NotNull Document document)
focal_class.full_signature: private static void throwNoCommitRootException(@NotNull Revision revision,
                                                     @NotNull Document document)
focal_class.identifier: throwNoCommitRootException
focal_class.modifiers: private static
focal_class.parameters: (@NotNull Revision revision,
                                                     @NotNull Document document)
focal_class.return: void
focal_class.signature: void throwNoCommitRootException(@NotNull Revision revision,
                                                     @NotNull Document document)
focal_method.body: boolean isConflicting() throws DocumentStoreException {
          // their revision is not conflicting when it is identified as branch
          // commit that cannot be merged (orphaned branch commit, theirRev is
          // garbage).
          if (document.getLocalBranchCommits().contains(theirRev)
                  && !startRevisions.isRevisionNewer(theirRev)) {
              return false;
          }
  
          // did their revision create or delete the node?
          if (document.getDeleted().containsKey(theirRev)) {
              return true;
          }
  
          for (Map.Entry<Key, Operation> entry : ourOp.getChanges().entrySet()) {
              String name = entry.getKey().getName();
              if (NodeDocument.isDeletedEntry(name)) {
                  // always conflicts because existence changed
                  return true;
              }
              if (isPropertyName(name)) {
                  if (document.getValueMap(name).containsKey(theirRev)) {
                      // concurrent change on the property
                      return true;
                  }
              }
          }
          return false;
      }
focal_method.class_method_signature: Collision.isConflicting()
focal_method.full_signature:  boolean isConflicting()
focal_method.identifier: isConflicting
focal_method.invocations: contains getLocalBranchCommits isRevisionNewer containsKey getDeleted entrySet getChanges getName getKey isDeletedEntry isPropertyName containsKey getValueMap
focal_method.parameters: ()
focal_method.return: boolean
focal_method.signature: boolean isConflicting()