From 5807d11b70f501c414422956d9b22cb063fa4f91 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Thu, 23 Apr 2009 17:07:36 +0000 Subject: [PATCH] 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 --- .../lucene/search/trie/AbstractTrieRangeQuery.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/queries/src/java/org/apache/lucene/search/trie/AbstractTrieRangeQuery.java b/contrib/queries/src/java/org/apache/lucene/search/trie/AbstractTrieRangeQuery.java index d9a9d2a6224..86f78e664ee 100644 --- a/contrib/queries/src/java/org/apache/lucene/search/trie/AbstractTrieRangeQuery.java +++ b/contrib/queries/src/java/org/apache/lucene/search/trie/AbstractTrieRangeQuery.java @@ -66,7 +66,9 @@ abstract class AbstractTrieRangeQuery extends MultiTermQuery { .append((min==null) ? "*" : min.toString()) .append(" TO ") .append((max==null) ? "*" : max.toString()) - .append(maxInclusive ? ']' : '}').toString(); + .append(maxInclusive ? ']' : '}') + .append(ToStringUtils.boost(getBoost())) + .toString(); } //@Override @@ -81,7 +83,8 @@ abstract class AbstractTrieRangeQuery extends MultiTermQuery { (q.max == null ? max == null : q.max.equals(max)) && minInclusive==q.minInclusive && maxInclusive==q.maxInclusive && - precisionStep==q.precisionStep + precisionStep==q.precisionStep && + getBoost()==q.getBoost() ); } return false; @@ -89,7 +92,8 @@ abstract class AbstractTrieRangeQuery extends MultiTermQuery { //@Override 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 (max!=null) hash += max.hashCode()^0x733fa5fe; return hash+