lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r828042 - in /lucene/java/trunk/src/java/org/apache/lucene/search: MultiSearcher.java ParallelMultiSearcher.java
Date Wed, 21 Oct 2009 15:16:27 GMT
Author: uschindler
Date: Wed Oct 21 15:16:26 2009
New Revision: 828042

URL: http://svn.apache.org/viewvc?rev=828042&view=rev
Log:
Add varargs to MultiSearcher

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

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java?rev=828042&r1=828041&r2=828042&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java Wed Oct 21 15:16:26
2009
@@ -117,7 +117,7 @@
   private int maxDoc = 0;
 
   /** Creates a searcher which searches <i>searchers</i>. */
-  public MultiSearcher(Searchable[] searchables) throws IOException {
+  public MultiSearcher(Searchable... searchables) throws IOException {
     this.searchables = searchables;
 
     starts = new int[searchables.length + 1];	  // build starts array

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=828042&r1=828041&r2=828042&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 15:16:26 2009
@@ -34,7 +34,7 @@
   private int[] starts;
 	
   /** Creates a searchable which searches <i>searchables</i>. */
-  public ParallelMultiSearcher(Searchable[] searchables) throws IOException {
+  public ParallelMultiSearcher(Searchable... searchables) throws IOException {
     super(searchables);
     this.searchables = searchables;
     this.starts = getStarts();
@@ -267,6 +267,8 @@
         scoreDoc.doc += starts[i]; // convert doc 
         //it would be so nice if we had a thread-safe insert 
         synchronized (hq) {
+          // this cast is bad, because we assume that the list has correct type.
+          // Because of that we have the @SuppressWarnings :-(
           if (scoreDoc == ((PriorityQueue<ScoreDoc>) hq).insertWithOverflow(scoreDoc))
             break;
         } // no more scores > minScore



Mime
View raw message