You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/06/15 16:00:31 UTC

[GitHub] [lucene-solr] murblanc commented on a change in pull request #1579: SOLR-14541: Ensure classes that implement equals implement hashCode or suppress warnings

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



##########
File path: solr/core/src/java/org/apache/solr/cloud/rule/Rule.java
##########
@@ -365,7 +365,7 @@ public boolean equals(Object obj) {
 
     @Override
     public int hashCode() {
-      throw new UnsupportedOperationException("TODO unimplemented");
+      return Objects.hash(name, fuzzy);

Review comment:
       Given that `fuzzy` is not included in the `equals()` implementation just above, we could have two instances that are `equals()` but that have different values for `hashCode()`. I believe this is not correct.




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



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