Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
-
None
-
None
-
New
Description
Custom subclasses of the Query class have the default implementation of hashCode/equals that make all instances of the subclass equal. If somebody doesn't know this it can be pretty tricky to debug with IndexSearcher's query cache on.
Is there any rationale for declaring it this way instead of making those methods abstract (and enforcing their proper implementation in a subclass)?
public int hashCode() { return getClass().hashCode(); } public boolean equals(Object obj) { if (obj == null) return false; return getClass() == obj.getClass(); }
Attachments
Attachments
Issue Links
- is related to
-
LUCENE-7295 TermAutomatonQuery.hashCode calculates Automaton.toDot().hash
- Resolved