nastra commented on code in PR #10023:
URL: https://github.com/apache/iceberg/pull/10023#discussion_r1535663017


##########
api/src/main/java/org/apache/iceberg/util/CharSequenceWrapper.java:
##########
@@ -67,7 +78,13 @@ public boolean equals(Object other) {
 
   @Override
   public int hashCode() {
-    return JavaHashes.hashCode(wrapped);
+    int hash = hashCode;

Review Comment:
   this uses a local `hash` var on purpose due to 
https://jeremymanson.blogspot.com/2008/12/benign-data-races-in-java.html. Also 
the `String` class itself uses the same approach when lazily calculating and 
caching a `hashCode`



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to