lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r828024 - /lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java
Date Wed, 21 Oct 2009 14:15:11 GMT
Author: uschindler
Date: Wed Oct 21 14:15:11 2009
New Revision: 828024

URL: http://svn.apache.org/viewvc?rev=828024&view=rev
Log:
Fix test failure because of wrong cast. Hard stuff :( Could be implemented better, the hq
is used for 2 different types

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java?rev=828024&r1=828023&r2=828024&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java Wed Oct
21 14:15:11 2009
@@ -199,7 +199,7 @@
   private int nDocs;
   private TopDocs docs;
   private int i;
-  private PriorityQueue<?> hq;
+  private PriorityQueue<? extends ScoreDoc> hq;
   private int[] starts;
   private IOException ioe;
   private Sort sort;
@@ -230,6 +230,7 @@
     this.sort = sort;
   }
 
+  @SuppressWarnings ("unchecked")
   public void run() {
     try {
       docs = (sort == null) ? searchable.search (weight, filter, nDocs)
@@ -266,7 +267,7 @@
         scoreDoc.doc += starts[i]; // convert doc 
         //it would be so nice if we had a thread-safe insert 
         synchronized (hq) {
-          if (scoreDoc == ((HitQueue) hq).insertWithOverflow(scoreDoc))
+          if (scoreDoc == ((PriorityQueue<ScoreDoc>) hq).insertWithOverflow(scoreDoc))
             break;
         } // no more scores > minScore
       }



Mime
View raw message