You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Erick Erickson (Jira)" <ji...@apache.org> on 2020/06/09 12:17:00 UTC

[jira] [Comment Edited] (SOLR-14541) Ensure classes that implement equals implement hashCode or suppress warnings

    [ https://issues.apache.org/jira/browse/SOLR-14541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17129213#comment-17129213 ] 

Erick Erickson edited comment on SOLR-14541 at 6/9/20, 12:16 PM:
-----------------------------------------------------------------

[~noble.paul] Thanks, I'll just suppress the warning when I get to autoscaling then.

 

I realize that it's not always necessary to implement hashCode, but I also know that we've had bugs because we haven't or the implementation has been faulty. I don't have time/energy to try to determine whether these are safe to omit in specific cases while in the middle of dealing with over 5,000 warnings of various types, so it's very helpful to have people like you who understand the particular code reassure me ;)

 

Joel Bernstein already weighed in on the ones in solrj/io, I'll rework the description in a moment.


was (Author: erickerickson):
[~noble.paul] Thanks, I'll just suppress the warning when I get to autoscaling then.

 

I realize that it's not always necessary to implement hashCode, but I also know that we've had bugs because we haven't in some cases. I don't have time/energy to try to determine whether these are safe to omit in specific cases while in the middle of dealing with over 5,000 warnings of various types, so it's very helpful to have people like you who understand the particular code reassure me ;)

 

Joel Bernstein already weighed in on the ones in solrj/io, I'll rework the description in a moment.

> Ensure classes that implement equals implement hashCode or suppress warnings
> ----------------------------------------------------------------------------
>
>                 Key: SOLR-14541
>                 URL: https://issues.apache.org/jira/browse/SOLR-14541
>             Project: Solr
>          Issue Type: Sub-task
>            Reporter: Erick Erickson
>            Assignee: Erick Erickson
>            Priority: Major
>
> While looking at warnings, I found that the following classes generate this warning:
> *overrides equals, but neither it nor any superclass overrides hashCode method*
> I can suppress the warning, but this has been a source of errors in the past so I'm reluctant to just do that blindly.
> NOTE: The Lucene one should probably be it's own Jira if it's going to have hashCode implemented, but here for triage.
> What I need for each method is for someone who has a clue about that particular code to render an opinion that we can safely suppress the warning or to provide a hashCode method.
> Some of these have been here for a very long time and were implemented by people no longer active...
> lucene/suggest/src/java/org/apache/lucene/search/spell/LuceneLevenshteinDistance.java:39
> solr/solrj/src/java/org/apache/solr/common/cloud/ZkNodeProps.java:34
>  solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java:26
>  solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java:49
> solr/core/src/java/org/apache/solr/cloud/rule/Rule.java:277
>  solr/core/src/java/org/apache/solr/pkg/PackageAPI.java:177
>  solr/core/src/java/org/apache/solr/packagemanager/SolrPackageInstance.java:31
>  
> Noble Paul says it's OK to suppress warnings for these:
> solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/VersionedData.java:31
>  solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/AutoScalingConfig.java:61
>  solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/AutoScalingConfig.java:150
>  solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/AutoScalingConfig.java:252
>  solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/AutoScalingConfig.java:45
>  solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java:73
>  solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Preference.java:32
>  solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/ReplicaInfo.java:39
>  
> Joel Bernstein says it's OK to suppress warnings for these:
>  solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/ReplicaCount.java:27
>  solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpression.java:25
>  solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionNamedParameter.java:23
>  solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java:467
>  solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DeepRandomStream.java:417
>  solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionValue.java:22 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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