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/25 01:05:33 UTC

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

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



##########
File path: solr/core/src/java/org/apache/solr/pkg/PackageAPI.java
##########
@@ -211,7 +211,7 @@ public boolean equals(Object obj) {
 
     @Override
     public int hashCode() {
-      throw new UnsupportedOperationException("TODO unimplemented");
+      return Objects.hash(version, manifestSHA512);

Review comment:
       WDYT about just version here? If we include files, computing the hashcode seems like it could get unreasonably expensive. It's not clear to me how long that list could be.
   
   Comparing two different packages that have the same version would break equals too so this seems safe.




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