test_class.declarator: rnd = new Random()
test_class.modifier: private
test_class.original_string: private Random rnd = new Random();
test_class.type: Random
test_class.var_name: rnd
test_class.file: oak-store-spi/src/test/java/org/apache/jackrabbit/oak/plugins/memory/AbstractBlobTest.java
test_class.identifier: AbstractBlobTest
test_case.body: @Test
      public void blobComparisonBasedOnContentIdentity() throws Exception {
          byte[] data = bytes(100);
          Blob a = new TestBlob(data, "id1", false);
          Blob b = new TestBlob(data, "id1", false);
          assertTrue(AbstractBlob.equal(a, b));
  
          Blob a2 = new TestBlob(data, "id1", true);
          Blob b2 = new TestBlob(data, "id2", true);
          assertTrue("Blobs with different id but same content should match", AbstractBlob.equal(a2, b2));
          assertFalse(a2.isInlined());
          assertFalse(b2.isInlined());
      }
test_case.class_method_signature: AbstractBlobTest.blobComparisonBasedOnContentIdentity()
test_case.full_signature: @Test public void blobComparisonBasedOnContentIdentity()
test_case.identifier: blobComparisonBasedOnContentIdentity
test_case.invocations: bytes assertTrue equal assertTrue equal assertFalse isInlined assertFalse isInlined
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void blobComparisonBasedOnContentIdentity()
focal_class.declarator: hashCode
focal_class.modifier: private
focal_class.original_string: private HashCode hashCode;
focal_class.type: HashCode
focal_class.var_name: hashCode
focal_class.file: oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/AbstractBlob.java
focal_class.identifier: AbstractBlob
focal_class.interfaces: implements Blob
focal_class.class_method_signature: AbstractBlob.supplier(final Blob blob)
focal_class.full_signature: private static ByteSource supplier(final Blob blob)
focal_class.identifier: supplier
focal_class.modifiers: private static
focal_class.parameters: (final Blob blob)
focal_class.return: ByteSource
focal_class.signature: ByteSource supplier(final Blob blob)
focal_class.class_method_signature: AbstractBlob.equal(Blob a, Blob b)
focal_class.full_signature: public static boolean equal(Blob a, Blob b)
focal_class.identifier: equal
focal_class.modifiers: public static
focal_class.parameters: (Blob a, Blob b)
focal_class.return: boolean
focal_class.signature: boolean equal(Blob a, Blob b)
focal_class.class_method_signature: AbstractBlob.calculateSha256(final Blob blob)
focal_class.full_signature: public static HashCode calculateSha256(final Blob blob)
focal_class.identifier: calculateSha256
focal_class.modifiers: public static
focal_class.parameters: (final Blob blob)
focal_class.return: HashCode
focal_class.signature: HashCode calculateSha256(final Blob blob)
focal_class.class_method_signature: AbstractBlob.AbstractBlob(HashCode hashCode)
focal_class.full_signature: protected  AbstractBlob(HashCode hashCode)
focal_class.identifier: AbstractBlob
focal_class.modifiers: protected
focal_class.parameters: (HashCode hashCode)
focal_class.signature:  AbstractBlob(HashCode hashCode)
focal_class.class_method_signature: AbstractBlob.AbstractBlob()
focal_class.full_signature: protected  AbstractBlob()
focal_class.identifier: AbstractBlob
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.signature:  AbstractBlob()
focal_class.class_method_signature: AbstractBlob.getSha256()
focal_class.full_signature: private synchronized HashCode getSha256()
focal_class.identifier: getSha256
focal_class.modifiers: private synchronized
focal_class.parameters: ()
focal_class.return: HashCode
focal_class.signature: HashCode getSha256()
focal_class.class_method_signature: AbstractBlob.sha256()
focal_class.full_signature: protected byte[] sha256()
focal_class.identifier: sha256
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: byte[]
focal_class.signature: byte[] sha256()
focal_class.class_method_signature: AbstractBlob.getReference()
focal_class.full_signature: @Override @Nullable public String getReference()
focal_class.identifier: getReference
focal_class.modifiers: @Override @Nullable public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getReference()
focal_class.class_method_signature: AbstractBlob.getContentIdentity()
focal_class.full_signature: @Override public String getContentIdentity()
focal_class.identifier: getContentIdentity
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getContentIdentity()
focal_class.class_method_signature: AbstractBlob.equals(Object other)
focal_class.full_signature: @Override public boolean equals(Object other)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object other)
focal_class.return: boolean
focal_class.signature: boolean equals(Object other)
focal_class.class_method_signature: AbstractBlob.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: AbstractBlob.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_method.body: public static boolean equal(Blob a, Blob b) {
          // shortcut: first compare lengths if known in advance
          long al = a.length();
          long bl = b.length();
          if (al != -1 && bl != -1 && al != bl) {
              return false; // blobs not equal, given known and non-equal lengths
          }
  
          String ai = a.getContentIdentity();
          String bi = b.getContentIdentity();
  
          //Check for identity first. If they are same then its
          //definitely same blob. If not we need to check further.
          if (ai != null && bi != null && ai.equals(bi)){
              return true;
          }
  
          try {
              return supplier(a).contentEquals(supplier(b));
          } catch (IOException e) {
              throw new IllegalStateException("Blob equality check failed", e);
          }
      }
focal_method.class_method_signature: AbstractBlob.equal(Blob a, Blob b)
focal_method.full_signature: public static boolean equal(Blob a, Blob b)
focal_method.identifier: equal
focal_method.invocations: length length getContentIdentity getContentIdentity equals contentEquals supplier supplier
focal_method.modifiers: public static
focal_method.parameters: (Blob a, Blob b)
focal_method.return: boolean
focal_method.signature: boolean equal(Blob a, Blob b)