murblanc commented on a change in pull request #1579:
URL: https://github.com/apache/lucene-solr/pull/1579#discussion_r440301532



##########
File path: solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
##########
@@ -383,10 +382,12 @@ public boolean equals(Object that) {
     return super.equals(that) && Objects.equals(this.name, other.name) && 
this.znodeVersion == other.znodeVersion;
   }
 
-//  @Override
-//  public int hashCode() {
-//    throw new UnsupportedOperationException("TODO unimplemented 
DocCollection.hashCode");
-//  }
+  @Override
+  public int hashCode() {
+    return Objects.hash(super.hashCode(), znodeVersion, name, 
replicationFactor,
+            numNrtReplicas, numTlogReplicas, numPullReplicas, maxShardsPerNode,
+            autoAddReplicas, policy, readOnly);

Review comment:
       The superclass (`ZkNodeProps`) `hashCode()` hashes the `props` map, so 
already takes care of producing a hash value based on `replicationFactor`, 
`numNrtReplicas`, `numTlogReplicas`, `numPullReplicas`, `maxShardsPerNode`, 
`autoAddReplicas`, `policy` and `readOnly` that were extracted from the map. 
These do not have to be added here again but it's **not** incorrect to have 
them.




----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to