lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r785222 - in /lucene/java/trunk/src/java/org/apache/lucene/search: BooleanClause.java Query.java
Date Tue, 16 Jun 2009 14:08:28 GMT
Author: mikemccand
Date: Tue Jun 16 14:08:28 2009
New Revision: 785222

URL: http://svn.apache.org/viewvc?rev=785222&view=rev
Log:
LUCENE-1694: fix Query.mergeBooleanQueries to take BooleanQuery[] param

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Query.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java?rev=785222&r1=785221&r2=785222&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java Tue Jun 16 14:08:28
2009
@@ -94,9 +94,9 @@
 
 
 
-  /** Returns true iff <code>o</code> is equal to this. */
+  /** Returns true if <code>o</code> is equal to this. */
   public boolean equals(Object o) {
-    if (!(o instanceof BooleanClause))
+    if (o == null || !(o instanceof BooleanClause))
       return false;
     BooleanClause other = (BooleanClause)o;
     return this.query.equals(other.query)

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Query.java?rev=785222&r1=785221&r2=785222&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Query.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Query.java Tue Jun 16 14:08:28 2009
@@ -169,17 +169,17 @@
    *
    *<p>A utility for use by {@link #combine(Query[])} implementations.
    */
-  public static Query mergeBooleanQueries(Query[] queries) {
+  public static Query mergeBooleanQueries(BooleanQuery[] queries) {
     HashSet allClauses = new HashSet();
     for (int i = 0; i < queries.length; i++) {
-      BooleanClause[] clauses = ((BooleanQuery)queries[i]).getClauses();
+      BooleanClause[] clauses = queries[i].getClauses();
       for (int j = 0; j < clauses.length; j++) {
         allClauses.add(clauses[j]);
       }
     }
 
     boolean coordDisabled =
-      queries.length==0? false : ((BooleanQuery)queries[0]).isCoordDisabled();
+      queries.length==0? false : queries[0].isCoordDisabled();
     BooleanQuery result = new BooleanQuery(coordDisabled);
     Iterator i = allClauses.iterator();
     while (i.hasNext()) {



Mime
View raw message