lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r883731 - in /lucene/java/branches/lucene_2_9: ./ CHANGES.txt src/java/org/apache/lucene/search/BooleanQuery.java src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
Date Tue, 24 Nov 2009 15:38:15 GMT
Author: mikemccand
Date: Tue Nov 24 15:38:15 2009
New Revision: 883731

URL: http://svn.apache.org/viewvc?rev=883731&view=rev
Log:
LUCENE-2092 (on 2.9 branch): fix BooleanQuery equals & hashCode to not ignore disableCoord

Modified:
    lucene/java/branches/lucene_2_9/   (props changed)
    lucene/java/branches/lucene_2_9/CHANGES.txt
    lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/BooleanQuery.java
    lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
  (props changed)

Propchange: lucene/java/branches/lucene_2_9/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 24 15:38:15 2009
@@ -1,2 +1,2 @@
 /lucene/java/branches/lucene_2_4:748824
-/lucene/java/trunk:824125,826029,826385,830871,833095,833297,833886,882672
+/lucene/java/trunk:824125,826029,826385,830871,833095,833297,833886,882672,883554

Modified: lucene/java/branches/lucene_2_9/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/CHANGES.txt?rev=883731&r1=883730&r2=883731&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/CHANGES.txt (original)
+++ lucene/java/branches/lucene_2_9/CHANGES.txt Tue Nov 24 15:38:15 2009
@@ -9,6 +9,10 @@
    infoStream on IndexWriter and then add an empty document and commit
    (Shai Erera via Mike McCandless)
 
+ * LUCENE-2092: BooleanQuery was ignoring disableCoord in its hashCode
+   and equals methods, cause bad things to happen when caching
+   BooleanQueries.  (Chris Hostetter, Mike McCandless)
+
  * LUCENE-2088: addAttribute() should only accept interfaces that
    extend Attribute. (Shai Erera, Uwe Schindler)
 

Modified: lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/BooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/BooleanQuery.java?rev=883731&r1=883730&r2=883731&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/BooleanQuery.java (original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/BooleanQuery.java Tue
Nov 24 15:38:15 2009
@@ -518,13 +518,14 @@
     BooleanQuery other = (BooleanQuery)o;
     return (this.getBoost() == other.getBoost())
         && this.clauses.equals(other.clauses)
-        && this.getMinimumNumberShouldMatch() == other.getMinimumNumberShouldMatch();
+        && this.getMinimumNumberShouldMatch() == other.getMinimumNumberShouldMatch()
+        && this.disableCoord == other.disableCoord;
   }
 
   /** Returns a hash code value for this object.*/
   public int hashCode() {
     return Float.floatToIntBits(getBoost()) ^ clauses.hashCode()
-           + getMinimumNumberShouldMatch();
+      + getMinimumNumberShouldMatch() + (disableCoord ? 17:0);
   }
   
 }

Propchange: lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 24 15:38:15 2009
@@ -1,2 +1,2 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java:748824
-/lucene/java/trunk/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java:818920,824125,826029,826385,830871,833095,833297,833886,882672
+/lucene/java/trunk/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java:818920,824125,826029,826385,830871,833095,833297,833886,882672,883554



Mime
View raw message