mirror of https://github.com/apache/lucene.git
LUCENE-1602: Fix incomplete toString(), hashcode() and equals() because boost was not involved there (copy'n'paste error from the Filter, which had no boost)
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@767982 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6a57acf9d4
commit
5807d11b70
|
@ -66,7 +66,9 @@ abstract class AbstractTrieRangeQuery extends MultiTermQuery {
|
||||||
.append((min==null) ? "*" : min.toString())
|
.append((min==null) ? "*" : min.toString())
|
||||||
.append(" TO ")
|
.append(" TO ")
|
||||||
.append((max==null) ? "*" : max.toString())
|
.append((max==null) ? "*" : max.toString())
|
||||||
.append(maxInclusive ? ']' : '}').toString();
|
.append(maxInclusive ? ']' : '}')
|
||||||
|
.append(ToStringUtils.boost(getBoost()))
|
||||||
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
|
@ -81,7 +83,8 @@ abstract class AbstractTrieRangeQuery extends MultiTermQuery {
|
||||||
(q.max == null ? max == null : q.max.equals(max)) &&
|
(q.max == null ? max == null : q.max.equals(max)) &&
|
||||||
minInclusive==q.minInclusive &&
|
minInclusive==q.minInclusive &&
|
||||||
maxInclusive==q.maxInclusive &&
|
maxInclusive==q.maxInclusive &&
|
||||||
precisionStep==q.precisionStep
|
precisionStep==q.precisionStep &&
|
||||||
|
getBoost()==q.getBoost()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -89,7 +92,8 @@ abstract class AbstractTrieRangeQuery extends MultiTermQuery {
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
public final int hashCode() {
|
public final int hashCode() {
|
||||||
int hash = field.hashCode() + (precisionStep^0x64365465);
|
int hash = Float.floatToIntBits(getBoost()) ^ field.hashCode();
|
||||||
|
hash += precisionStep^0x64365465;
|
||||||
if (min!=null) hash += min.hashCode()^0x14fa55fb;
|
if (min!=null) hash += min.hashCode()^0x14fa55fb;
|
||||||
if (max!=null) hash += max.hashCode()^0x733fa5fe;
|
if (max!=null) hash += max.hashCode()^0x733fa5fe;
|
||||||
return hash+
|
return hash+
|
||||||
|
|
Loading…
Reference in New Issue