test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionVectorTest.java
test_class.identifier: RevisionVectorTest
test_case.body: @Test
      public void difference() {
          RevisionVector rv1 = new RevisionVector();
          RevisionVector rv2 = new RevisionVector();
          assertEquals(new RevisionVector(), rv1.difference(rv2));
  
          Revision r11 = new Revision(1, 0, 1);
          rv1 = rv1.update(r11);
          // rv1: [r1-0-1]
          assertEquals(new RevisionVector(r11), rv1.difference(rv2));
          assertEquals(new RevisionVector(), rv2.difference(rv1));
  
          rv2 = rv2.update(r11);
          // rv1: [r1-0-1], rv2: [r1-0-1]
          assertEquals(new RevisionVector(), rv1.difference(rv2));
          assertEquals(new RevisionVector(), rv2.difference(rv1));
  
          Revision r12 = new Revision(1, 0, 2);
          rv1 = rv1.update(r12);
          // rv1: [r1-0-1, r1-0-2], rv2: [r1-0-1]
          assertEquals(new RevisionVector(r12), rv1.difference(rv2));
          assertEquals(new RevisionVector(), rv2.difference(rv1));
  
          Revision r22 = new Revision(2, 0, 2);
          rv2 = rv2.update(r22);
          // rv1: [r1-0-1, r1-0-2], rv2: [r1-0-1, r2-0-2]
          assertEquals(new RevisionVector(r12), rv1.difference(rv2));
          assertEquals(new RevisionVector(r22), rv2.difference(rv1));
  
          Revision r21 = new Revision(2, 0, 1);
          rv1 = rv1.update(r21);
          // rv1: [r2-0-1, r1-0-2], rv2: [r1-0-1, r2-0-2]
          assertEquals(new RevisionVector(r21, r12), rv1.difference(rv2));
          assertEquals(new RevisionVector(r11, r22), rv2.difference(rv1));
      }
test_case.class_method_signature: RevisionVectorTest.difference()
test_case.full_signature: @Test public void difference()
test_case.identifier: difference
test_case.invocations: assertEquals difference update assertEquals difference assertEquals difference update assertEquals difference assertEquals difference update assertEquals difference assertEquals difference update assertEquals difference assertEquals difference update assertEquals difference assertEquals difference
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void difference()
focal_class.declarator: log = LoggerFactory.getLogger(RevisionVector.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(RevisionVector.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: EMPTY = new RevisionVector()
focal_class.modifier: private final static
focal_class.original_string: private final static RevisionVector EMPTY = new RevisionVector();
focal_class.type: RevisionVector
focal_class.var_name: EMPTY
focal_class.declarator: revisions
focal_class.modifier: private final
focal_class.original_string: private final Revision[] revisions;
focal_class.type: Revision[]
focal_class.var_name: revisions
focal_class.declarator: hash
focal_class.modifier: private
focal_class.original_string: private int hash;
focal_class.type: int
focal_class.var_name: hash
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/RevisionVector.java
focal_class.identifier: RevisionVector
focal_class.interfaces: implements Iterable<Revision>, Comparable<RevisionVector>, CacheValue
focal_class.class_method_signature: RevisionVector.RevisionVector(@NotNull Revision[] revisions,
                             boolean checkUniqueClusterIds,
                             boolean sort)
focal_class.full_signature: private  RevisionVector(@NotNull Revision[] revisions,
                             boolean checkUniqueClusterIds,
                             boolean sort)
focal_class.identifier: RevisionVector
focal_class.modifiers: private
focal_class.parameters: (@NotNull Revision[] revisions,
                             boolean checkUniqueClusterIds,
                             boolean sort)
focal_class.signature:  RevisionVector(@NotNull Revision[] revisions,
                             boolean checkUniqueClusterIds,
                             boolean sort)
focal_class.class_method_signature: RevisionVector.RevisionVector(@NotNull Revision... revisions)
focal_class.full_signature: public  RevisionVector(@NotNull Revision... revisions)
focal_class.identifier: RevisionVector
focal_class.modifiers: public
focal_class.parameters: (@NotNull Revision... revisions)
focal_class.signature:  RevisionVector(@NotNull Revision... revisions)
focal_class.class_method_signature: RevisionVector.RevisionVector(@NotNull Iterable<Revision> revisions)
focal_class.full_signature: public  RevisionVector(@NotNull Iterable<Revision> revisions)
focal_class.identifier: RevisionVector
focal_class.modifiers: public
focal_class.parameters: (@NotNull Iterable<Revision> revisions)
focal_class.signature:  RevisionVector(@NotNull Iterable<Revision> revisions)
focal_class.class_method_signature: RevisionVector.RevisionVector(@NotNull Set<Revision> revisions)
focal_class.full_signature: public  RevisionVector(@NotNull Set<Revision> revisions)
focal_class.identifier: RevisionVector
focal_class.modifiers: public
focal_class.parameters: (@NotNull Set<Revision> revisions)
focal_class.signature:  RevisionVector(@NotNull Set<Revision> revisions)
focal_class.class_method_signature: RevisionVector.update(@NotNull Revision revision)
focal_class.full_signature: public RevisionVector update(@NotNull Revision revision)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (@NotNull Revision revision)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector update(@NotNull Revision revision)
focal_class.class_method_signature: RevisionVector.remove(int clusterId)
focal_class.full_signature: public RevisionVector remove(int clusterId)
focal_class.identifier: remove
focal_class.modifiers: public
focal_class.parameters: (int clusterId)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector remove(int clusterId)
focal_class.class_method_signature: RevisionVector.pmin(@NotNull RevisionVector vector)
focal_class.full_signature: public RevisionVector pmin(@NotNull RevisionVector vector)
focal_class.identifier: pmin
focal_class.modifiers: public
focal_class.parameters: (@NotNull RevisionVector vector)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector pmin(@NotNull RevisionVector vector)
focal_class.class_method_signature: RevisionVector.pmax(@NotNull RevisionVector vector)
focal_class.full_signature: public RevisionVector pmax(@NotNull RevisionVector vector)
focal_class.identifier: pmax
focal_class.modifiers: public
focal_class.parameters: (@NotNull RevisionVector vector)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector pmax(@NotNull RevisionVector vector)
focal_class.class_method_signature: RevisionVector.difference(RevisionVector vector)
focal_class.full_signature: public RevisionVector difference(RevisionVector vector)
focal_class.identifier: difference
focal_class.modifiers: public
focal_class.parameters: (RevisionVector vector)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector difference(RevisionVector vector)
focal_class.class_method_signature: RevisionVector.isRevisionNewer(@NotNull Revision revision)
focal_class.full_signature: public boolean isRevisionNewer(@NotNull Revision revision)
focal_class.identifier: isRevisionNewer
focal_class.modifiers: public
focal_class.parameters: (@NotNull Revision revision)
focal_class.return: boolean
focal_class.signature: boolean isRevisionNewer(@NotNull Revision revision)
focal_class.class_method_signature: RevisionVector.isBranch()
focal_class.full_signature: public boolean isBranch()
focal_class.identifier: isBranch
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isBranch()
focal_class.class_method_signature: RevisionVector.getBranchRevision()
focal_class.full_signature: @NotNull public Revision getBranchRevision()
focal_class.identifier: getBranchRevision
focal_class.modifiers: @NotNull public
focal_class.parameters: ()
focal_class.return: Revision
focal_class.signature: Revision getBranchRevision()
focal_class.class_method_signature: RevisionVector.getRevision(int clusterId)
focal_class.full_signature: public Revision getRevision(int clusterId)
focal_class.identifier: getRevision
focal_class.modifiers: public
focal_class.parameters: (int clusterId)
focal_class.return: Revision
focal_class.signature: Revision getRevision(int clusterId)
focal_class.class_method_signature: RevisionVector.asString()
focal_class.full_signature: public String asString()
focal_class.identifier: asString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String asString()
focal_class.class_method_signature: RevisionVector.toStringBuilder(StringBuilder sb)
focal_class.full_signature: public StringBuilder toStringBuilder(StringBuilder sb)
focal_class.identifier: toStringBuilder
focal_class.modifiers: public
focal_class.parameters: (StringBuilder sb)
focal_class.return: StringBuilder
focal_class.signature: StringBuilder toStringBuilder(StringBuilder sb)
focal_class.class_method_signature: RevisionVector.fromString(String s)
focal_class.full_signature: public static RevisionVector fromString(String s)
focal_class.identifier: fromString
focal_class.modifiers: public static
focal_class.parameters: (String s)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector fromString(String s)
focal_class.class_method_signature: RevisionVector.asTrunkRevision()
focal_class.full_signature: public RevisionVector asTrunkRevision()
focal_class.identifier: asTrunkRevision
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: RevisionVector
focal_class.signature: RevisionVector asTrunkRevision()
focal_class.class_method_signature: RevisionVector.asBranchRevision(int clusterId)
focal_class.full_signature: public RevisionVector asBranchRevision(int clusterId)
focal_class.identifier: asBranchRevision
focal_class.modifiers: public
focal_class.parameters: (int clusterId)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector asBranchRevision(int clusterId)
focal_class.class_method_signature: RevisionVector.getDimensions()
focal_class.full_signature: public int getDimensions()
focal_class.identifier: getDimensions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getDimensions()
focal_class.class_method_signature: RevisionVector.getMemory()
focal_class.full_signature: @Override public int getMemory()
focal_class.identifier: getMemory
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMemory()
focal_class.class_method_signature: RevisionVector.compareTo(@NotNull RevisionVector other)
focal_class.full_signature: @Override public int compareTo(@NotNull RevisionVector other)
focal_class.identifier: compareTo
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull RevisionVector other)
focal_class.return: int
focal_class.signature: int compareTo(@NotNull RevisionVector other)
focal_class.class_method_signature: RevisionVector.iterator()
focal_class.full_signature: @Override public Iterator<Revision> iterator()
focal_class.identifier: iterator
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Iterator<Revision>
focal_class.signature: Iterator<Revision> iterator()
focal_class.class_method_signature: RevisionVector.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: RevisionVector.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: RevisionVector.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: RevisionVector.peekRevision(PeekingIterator<Revision> it,
                                    int minClusterId)
focal_class.full_signature: @Nullable private Revision peekRevision(PeekingIterator<Revision> it,
                                    int minClusterId)
focal_class.identifier: peekRevision
focal_class.modifiers: @Nullable private
focal_class.parameters: (PeekingIterator<Revision> it,
                                    int minClusterId)
focal_class.return: Revision
focal_class.signature: Revision peekRevision(PeekingIterator<Revision> it,
                                    int minClusterId)
focal_class.class_method_signature: RevisionVector.revisionArrayMemory()
focal_class.full_signature: private long revisionArrayMemory()
focal_class.identifier: revisionArrayMemory
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long revisionArrayMemory()
focal_class.class_method_signature: RevisionVector.checkUniqueClusterIds(Revision[] revisions)
focal_class.full_signature: private static void checkUniqueClusterIds(Revision[] revisions)
focal_class.identifier: checkUniqueClusterIds
focal_class.modifiers: private static
focal_class.parameters: (Revision[] revisions)
focal_class.return: void
focal_class.signature: void checkUniqueClusterIds(Revision[] revisions)
focal_method.body: public RevisionVector difference(RevisionVector vector) {
          List<Revision> diff = newArrayListWithCapacity(revisions.length);
          PeekingIterator<Revision> it = peekingIterator(vector.iterator());
          for (Revision r : revisions) {
              Revision other = peekRevision(it, r.getClusterId());
              if (!r.equals(other)) {
                  diff.add(r);
              }
          }
          return new RevisionVector(toArray(diff, Revision.class), false, false);
      }
focal_method.class_method_signature: RevisionVector.difference(RevisionVector vector)
focal_method.full_signature: public RevisionVector difference(RevisionVector vector)
focal_method.identifier: difference
focal_method.invocations: newArrayListWithCapacity peekingIterator iterator peekRevision getClusterId equals add toArray
focal_method.modifiers: public
focal_method.parameters: (RevisionVector vector)
focal_method.return: RevisionVector
focal_method.signature: RevisionVector difference(RevisionVector vector)