chia7712 commented on code in PR #16062: URL: https://github.com/apache/kafka/pull/16062#discussion_r1616238052
########## clients/src/main/java/org/apache/kafka/common/PartitionInfo.java: ########## @@ -88,6 +90,28 @@ public Node[] offlineReplicas() { return offlineReplicas; } + @Override + public int hashCode() { + return Objects.hash(topic, partition, leader, replicas, inSyncReplicas, offlineReplicas); Review Comment: My point was that `Objects.hash` will call `object#hashCode` for those array object, and it will return the object reference. It seems to me that is not we expect, and we can fix it by following example: ```java Objects.hash(topic, partition, leader, Arrays.hashCode(replicas), Arrays.hashCode(inSyncReplicas), Arrays.hashCode(offlineReplicas)); ``` -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org