mbaedke commented on code in PR #2372:
URL: https://github.com/apache/jackrabbit-oak/pull/2372#discussion_r2189696299


##########
oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/AbstractBlob.java:
##########
@@ -189,4 +182,39 @@ public String toString() {
         return getSha256().toString();
     }
 
+    public static class HashCode {
+
+        private byte[] digest;
+
+        private HashCode(byte[] digest){
+            this.digest = digest;
+        }
+
+        private static HashCode of(byte[] bytes) {
+            try {
+                return new 
HashCode(MessageDigest.getInstance("SHA-256").digest(bytes));
+            } catch (NoSuchAlgorithmException ex) {
+                throw new IllegalStateException("no SHA256 digest", ex);
+            }
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o == null || getClass() != o.getClass()) return false;

Review Comment:
   That is no good. The actual param could be of a derived class. I'd use "if 
(!(o instanceof AbstractBlob))"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to