SiyaoIsHiding commented on code in PR #1644:
URL: 
https://github.com/apache/cassandra-java-driver/pull/1644#discussion_r1892191181


##########
core/src/main/java/com/datastax/oss/driver/internal/core/metadata/token/TokenRangeBase.java:
##########
@@ -275,7 +274,7 @@ public boolean equals(Object other) {
 
   @Override
   public int hashCode() {
-    return Objects.hash(start, end);
+    return 31 * start.hashCode() + end.hashCode();

Review Comment:
   According to 
[List.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#hashCode--)
   
   ```
        int hashCode = 1;
        for (E e : list)
            hashCode = 31*hashCode + (e==null ? 0 : e.hashCode());
   ```
   It seems to me that it should be ` (31 + start.hashCode()) * 31 + 
end.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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to