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:
Yonik Seeley 2006-10-25 04:24:10 +00:00
parent 71c3f0332d
commit 7eca52679f
1 changed files with 2 additions and 2 deletions

View File

@ -176,13 +176,13 @@ extends Query {
public boolean equals(Object o) {
if (o instanceof FilteredQuery) {
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;
}
/** Returns a hash code value for this object. */
public int hashCode() {
return query.hashCode() ^ filter.hashCode();
return query.hashCode() ^ filter.hashCode() + Float.floatToRawIntBits(getBoost());
}
}