[
https://issues.apache.org/jira/browse/LUCENE-6372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14530355#comment-14530355
]
Paul Elschot commented on LUCENE-6372:
--------------------------------------
One typical case for equals() is a newly constructed query compared against a
query as a key in a cache.
In that case the this == other test in Query.equals() will fail, so it can just
as well be removed, and never done.
Are there other typical cases for Query.equals()?
For example one could cache the result of a query parser by its input string,
and reuse a query from that cache to check a cache with query results. In that
case the this == other test might help in equals() for non abstract Query
subclasses.
> Simplify hashCode/equals for SpanQuery subclasses
> -------------------------------------------------
>
> Key: LUCENE-6372
> URL: https://issues.apache.org/jira/browse/LUCENE-6372
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Paul Elschot
> Attachments: LUCENE-6372.patch, LUCENE-6372.patch
>
>
> Spin off from LUCENE-6308, see the comments there from around 23 March 2015.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]