mirror of https://github.com/apache/lucene.git
factor boost into hashCode and equals to pass generic tests: LUCENE-698
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@467559 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
71c3f0332d
commit
7eca52679f
|
@ -176,13 +176,13 @@ extends Query {
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o instanceof FilteredQuery) {
|
if (o instanceof FilteredQuery) {
|
||||||
FilteredQuery fq = (FilteredQuery) o;
|
FilteredQuery fq = (FilteredQuery) o;
|
||||||
return (query.equals(fq.query) && filter.equals(fq.filter));
|
return (query.equals(fq.query) && filter.equals(fq.filter) && getBoost()==fq.getBoost());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a hash code value for this object. */
|
/** Returns a hash code value for this object. */
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return query.hashCode() ^ filter.hashCode();
|
return query.hashCode() ^ filter.hashCode() + Float.floatToRawIntBits(getBoost());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue