This is an automated email from the ASF dual-hosted git repository. reschke pushed a commit to branch OAK-11792b in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit dd835dc8a4467c20feeb22e88377a8812c6296ba Author: Julian Reschke <[email protected]> AuthorDate: Tue Jul 8 15:39:12 2025 +0100 OAK-11792: remove usage of Guava common.hash - remove dead code --- .../oak/plugins/memory/AbstractBlob.java | 37 +--------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/AbstractBlob.java b/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/AbstractBlob.java index f0bca90bf9..6f4b4f8c5b 100644 --- a/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/AbstractBlob.java +++ b/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/AbstractBlob.java @@ -19,7 +19,6 @@ package org.apache.jackrabbit.oak.plugins.memory; import java.io.IOException; -import java.io.InputStream; import org.apache.commons.io.IOUtils; import org.apache.jackrabbit.guava.common.hash.HashCode; @@ -27,7 +26,6 @@ import org.apache.jackrabbit.guava.common.hash.Hashing; import org.apache.jackrabbit.oak.api.Blob; import org.apache.jackrabbit.oak.commons.properties.SystemPropertySupplier; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,7 +64,7 @@ public abstract class AbstractBlob implements Blob { //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)){ + if (ai != null && ai.equals(bi)){ return true; } @@ -81,31 +79,6 @@ public abstract class AbstractBlob implements Blob { } } - public static HashCode calculateSha256(final Blob blob) { - AbstractBlob ab; - if (blob instanceof AbstractBlob) { - ab = ((AbstractBlob) blob); - } else { - ab = new AbstractBlob() { - @Override - public long length() { - return blob.length(); - } - - @Override public boolean isInlined() { - return blob.isInlined(); - } - - @NotNull - @Override - public InputStream getNewStream() { - return blob.getNewStream(); - } - }; - } - return ab.getSha256(); - } - private HashCode hashCode; // synchronized access protected AbstractBlob(HashCode hashCode) { @@ -128,14 +101,6 @@ public abstract class AbstractBlob implements Blob { return hashCode; } - /** - * This hash code implementation returns the hash code of the underlying stream - * @return a byte array of the hash - */ - protected byte[] sha256() { - return getSha256().asBytes(); - } - //--------------------------------------------------------------< Blob >-- @Override @Nullable
