[ 
https://issues.apache.org/jira/browse/LUCENE-6333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lee Hinman updated LUCENE-6333:
-------------------------------
    Attachment: LUCENE-6333.patch

Here's a patch that cleans up the hashCode and equals methods for most queries.

I removed the extra {{getBoost}} comparison because the Query superclass does 
that comparison. I was also able to remove some overridden methods that only 
did exactly what the {{Query}} implementation does.

> Clean up overridden .equals and .hashCode methods in Query subclasses
> ---------------------------------------------------------------------
>
>                 Key: LUCENE-6333
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6333
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 5.0
>            Reporter: Lee Hinman
>            Priority: Minor
>         Attachments: LUCENE-6333.patch
>
>
> As a followup to LUCENE-6304, all classes that subclass Query and override 
> the {{equals}} and {{hashCode}} methods should call super.equals/hashCode 
> and, when possible, not override the methods at all.
> For example, TermQuery.hashCode overrides the Query.hashCode, but will be 
> exactly the same code once LUCENE-6304 is merged.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to