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/10 15:05:49 UTC

[GitHub] [zookeeper] belugabehr opened a new pull request #1214: ZOOKEEPER-3686: Use JDK Arrays hashCode for Jute

belugabehr opened a new pull request #1214: ZOOKEEPER-3686: Use JDK Arrays hashCode for Jute
URL: https://github.com/apache/zookeeper/pull/1214
 
 
   

----------------------------------------------------------------
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

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

Posted by GitBox <gi...@apache.org>.
maoling 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_r365636788
 
 

 ##########
 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:
   - their will generate different `hashcode`?
   - these two methods accept `array` parameter, not support the parameter `string`?

----------------------------------------------------------------
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

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

Posted by GitBox <gi...@apache.org>.
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

[GitHub] [zookeeper] nkalmar commented on issue #1214: ZOOKEEPER-3686: Use JDK Arrays hashCode for Jute

Posted by GitBox <gi...@apache.org>.
nkalmar commented on issue #1214: ZOOKEEPER-3686: Use JDK Arrays hashCode for Jute
URL: https://github.com/apache/zookeeper/pull/1214#issuecomment-585243056
 
 
   Merged to master, thanks @belugabehr 

----------------------------------------------------------------
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

[GitHub] [zookeeper] asfgit closed pull request #1214: ZOOKEEPER-3686: Use JDK Arrays hashCode for Jute

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1214: ZOOKEEPER-3686: Use JDK Arrays hashCode for Jute
URL: https://github.com/apache/zookeeper/pull/1214
 
 
   

----------------------------------------------------------------
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