lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1298363 - in /lucene/dev/trunk/modules/join/src: java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java test/org/apache/lucene/search/join/TestBlockJoin.java
Date Thu, 08 Mar 2012 11:20:51 GMT
Author: mvg
Date: Thu Mar  8 11:20:50 2012
New Revision: 1298363

URL: http://svn.apache.org/viewvc?rev=1298363&view=rev
Log:
LUCENE-3850: Removed some of the rawtypes compiler warnings

Modified:
    lucene/dev/trunk/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java
    lucene/dev/trunk/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java

Modified: lucene/dev/trunk/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java?rev=1298363&r1=1298362&r2=1298363&view=diff
==============================================================================
--- lucene/dev/trunk/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java
(original)
+++ lucene/dev/trunk/modules/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java
Thu Mar  8 11:20:50 2012
@@ -17,33 +17,17 @@ package org.apache.lucene.search.join;
  * limitations under the License.
  */
 
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Queue;
-
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.IndexWriter;       // javadocs
-import org.apache.lucene.search.Collector;
-import org.apache.lucene.search.FieldComparator;
-import org.apache.lucene.search.FieldValueHitQueue;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.ScoreCachingWrappingScorer;
-import org.apache.lucene.search.Scorer;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.search.*;
 import org.apache.lucene.search.Scorer.ChildScorer;
-import org.apache.lucene.search.Sort;
-import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.search.TopDocsCollector;
-import org.apache.lucene.search.TopFieldCollector;
-import org.apache.lucene.search.TopScoreDocCollector;
-import org.apache.lucene.search.Weight;
 import org.apache.lucene.search.grouping.GroupDocs;
 import org.apache.lucene.search.grouping.TopGroups;
 import org.apache.lucene.util.ArrayUtil;
 
+import java.io.IOException;
+import java.util.*;
+
 
 /** Collects parent document hits for a Query containing one more more
  *  BlockJoinQuery clauses, sorted by the
@@ -399,6 +383,7 @@ public class ToParentBlockJoinCollector 
 
     final FakeScorer fakeScorer = new FakeScorer();
 
+    @SuppressWarnings({"unchecked","rawtypes"})
     final GroupDocs<Integer>[] groups = new GroupDocs[sortedGroups.length - offset];
 
     for(int groupIDX=offset;groupIDX<sortedGroups.length;groupIDX++) {

Modified: lucene/dev/trunk/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java?rev=1298363&r1=1298362&r2=1298363&view=diff
==============================================================================
--- lucene/dev/trunk/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
(original)
+++ lucene/dev/trunk/modules/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
Thu Mar  8 11:20:50 2012
@@ -17,32 +17,20 @@ package org.apache.lucene.search.join;
  * limitations under the License.
  */
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
 import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.IntField;
-import org.apache.lucene.document.StoredField;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.LogDocMergePolicy;
-import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.Term;
+import org.apache.lucene.document.*;
+import org.apache.lucene.index.*;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.search.grouping.GroupDocs;
 import org.apache.lucene.search.grouping.TopGroups;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.FixedBitSet;
-import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.ReaderUtil;
-import org.apache.lucene.util._TestUtil;
+import org.apache.lucene.util.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class TestBlockJoin extends LuceneTestCase {
 
@@ -149,7 +137,7 @@ public class TestBlockJoin extends Lucen
     childDoc = s.doc(hits.scoreDocs[0].doc);
     //System.out.println("CHILD = " + childDoc + " docID=" + hits.scoreDocs[0].doc);
     assertEquals("java", childDoc.get("skill"));
-    assertEquals(2007, ((StoredField) childDoc.getField("year")).numericValue());
+    assertEquals(2007, (childDoc.getField("year")).numericValue());
     assertEquals("Lisa", getParentDoc(r, parentsFilter, hits.scoreDocs[0].doc).get("name"));
 
     // Test with filter on child docs:
@@ -338,7 +326,7 @@ public class TestBlockJoin extends Lucen
 
       if (VERBOSE) {
         StringBuilder sb = new StringBuilder();
-        sb.append("parentID=" + parentDoc.get("parentID"));
+        sb.append("parentID=").append(parentDoc.get("parentID"));
         for(int fieldID=0;fieldID<parentFields.length;fieldID++) {
           String s = parentDoc.get("parent" + fieldID);
           if (s != null) {
@@ -371,7 +359,7 @@ public class TestBlockJoin extends Lucen
 
         if (VERBOSE) {
           StringBuilder sb = new StringBuilder();
-          sb.append("childID=" + joinChildDoc.get("childID"));
+          sb.append("childID=").append(joinChildDoc.get("childID"));
           for(int fieldID=0;fieldID<childFields.length;fieldID++) {
             String s = joinChildDoc.get("child" + fieldID);
             if (s != null) {
@@ -755,7 +743,7 @@ public class TestBlockJoin extends Lucen
 
       FieldDoc hit0 = (FieldDoc) hit;
       FieldDoc joinHit0 = (FieldDoc) joinHit;
-      assertEquals(hit0.fields, joinHit0.fields);
+      assertArrayEquals(hit0.fields, joinHit0.fields);
     }
   }
 



Mime
View raw message