lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r763840 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/search/RangeQuery.java src/test/org/apache/lucene/search/TestRangeQuery.java
Date Fri, 10 Apr 2009 00:40:31 GMT
Author: markrmiller
Date: Fri Apr 10 00:40:31 2009
New Revision: 763840

URL: http://svn.apache.org/viewvc?rev=763840&view=rev
Log:
LUCENE-1587: RangeQuery#equals() could consider a RangeQuery without a collator equal to one
with a collator.

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=763840&r1=763839&r2=763840&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Fri Apr 10 00:40:31 2009
@@ -57,7 +57,7 @@
    Rutherglen via Mike McCandless)
 
 9. LUCENE-1186: Add Analyzer.close() to free internal ThreadLocal
-   resources.  (Christian Kohlschütter via Mike McCandless)
+   resources.  (Christian Kohlsch�tter via Mike McCandless)
 
 10. LUCENE-652: Added org.apache.lucene.document.CompressionTools, to
     enable compressing & decompressing binary content, external to
@@ -96,7 +96,7 @@
    (Mike McCandless via Doug Sale)
 
 6. LUCENE-1186: Add Analyzer.close() to free internal ThreadLocal
-   resources.  (Christian Kohlschütter via Mike McCandless)
+   resources.  (Christian Kohlsch�tter via Mike McCandless)
 
 7. LUCENE-1327: Fix TermSpans#skipTo() to behave as specified in javadocs
    of Terms#skipTo(). (Michael Busch)
@@ -113,6 +113,11 @@
    omitTermFreqAndPositions=false (though these values are unused).
    (Uwe Schindler via Mike McCandless)
 
+10. LUCENE-1587: RangeQuery#equals() could consider a RangeQuery
+    without a collator equal to one with a collator.
+    (Mark Platvoet via Mark Miller) 
+
+
 New features
 
  1. LUCENE-1411: Added expert API to open an IndexWriter on a prior

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java?rev=763840&r1=763839&r2=763840&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/RangeQuery.java Fri Apr 10 00:40:31
2009
@@ -204,7 +204,7 @@
     if (this.field != other.field  // interned comparison
         || this.includeLower != other.includeLower
         || this.includeUpper != other.includeUpper
-        || (this.collator != null && ! this.collator.equals(other.collator))
+        || (this.collator != null && ! this.collator.equals(other.collator) || (this.collator
== null && other.collator != null))
        ) { return false; }
     String lowerVal = this.lowerTerm == null ? null : lowerTerm.text();
     String upperVal = this.upperTerm == null ? null : upperTerm.text();

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java?rev=763840&r1=763839&r2=763840&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestRangeQuery.java Fri Apr 10 00:40:31
2009
@@ -145,6 +145,10 @@
     query = new RangeQuery("content", "A", "C", false, false);
     other = new RangeQuery("content", "A", "C", true, true);
     assertFalse("queries with different inclusive are not equal", query.equals(other));
+    
+    query = new RangeQuery("content", "A", "C", false, false);
+    other = new RangeQuery("content", "A", "C", false, false, Collator.getInstance());
+    assertFalse("a query with a collator is not equal to one without", query.equals(other));
   }
 
   public void testExclusiveCollating() throws Exception {



Mime
View raw message