You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/01/13 03:44:25 UTC

[GitHub] [zookeeper] belugabehr commented on a change in pull request #1214: ZOOKEEPER-3686: Use JDK Arrays hashCode for Jute

belugabehr commented on a change in pull request #1214: ZOOKEEPER-3686: Use JDK Arrays hashCode for Jute
URL: https://github.com/apache/zookeeper/pull/1214#discussion_r365640174
 
 

 ##########
 File path: zookeeper-jute/src/main/java/org/apache/jute/compiler/JBuffer.java
 ##########
 @@ -79,7 +79,7 @@ public String genJavaEquals(String fname, String peer) {
     }
 
     public String genJavaHashCode(String fname) {
-        return "    ret = java.util.Arrays.toString(" + fname + ").hashCode();\n";
+        return "    ret = java.util.Arrays.hashCode(" + fname + ");\n";
     }
 
 Review comment:
   * Yes.  Will generate different hashcodes.  Doesn't matter as hashcodes are not persisted anywhere (that I know of... that is just not a common thing to do).
   * This method accepts `byte[]` which is the data type being used here.  The `fname` is just the name of the field, not the value being hashcode'ed

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services