LUCENE-3850: Removed some of the rawtypes compiler warnings

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1298363 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Martijn van Groningen 2012-03-08 11:20:50 +00:00
parent 00348bbda6
commit 7b379ea65b
2 changed files with 18 additions and 45 deletions

View File

@ -17,33 +17,17 @@ package org.apache.lucene.search.join;
* limitations under the License. * 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.AtomicReaderContext;
import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriter; // javadocs import org.apache.lucene.search.*;
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.search.Scorer.ChildScorer; 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.GroupDocs;
import org.apache.lucene.search.grouping.TopGroups; import org.apache.lucene.search.grouping.TopGroups;
import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.ArrayUtil;
import java.io.IOException;
import java.util.*;
/** Collects parent document hits for a Query containing one more more /** Collects parent document hits for a Query containing one more more
* BlockJoinQuery clauses, sorted by the * BlockJoinQuery clauses, sorted by the
@ -399,6 +383,7 @@ public class ToParentBlockJoinCollector extends Collector {
final FakeScorer fakeScorer = new FakeScorer(); final FakeScorer fakeScorer = new FakeScorer();
@SuppressWarnings({"unchecked","rawtypes"})
final GroupDocs<Integer>[] groups = new GroupDocs[sortedGroups.length - offset]; final GroupDocs<Integer>[] groups = new GroupDocs[sortedGroups.length - offset];
for(int groupIDX=offset;groupIDX<sortedGroups.length;groupIDX++) { for(int groupIDX=offset;groupIDX<sortedGroups.length;groupIDX++) {

View File

@ -17,32 +17,20 @@ package org.apache.lucene.search.join;
* limitations under the License. * 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.analysis.MockAnalyzer;
import org.apache.lucene.document.Document; import org.apache.lucene.document.*;
import org.apache.lucene.document.Field; import org.apache.lucene.index.*;
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.search.*; import org.apache.lucene.search.*;
import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.grouping.GroupDocs; import org.apache.lucene.search.grouping.GroupDocs;
import org.apache.lucene.search.grouping.TopGroups; import org.apache.lucene.search.grouping.TopGroups;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.*;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.LuceneTestCase; import java.io.IOException;
import org.apache.lucene.util.ReaderUtil; import java.util.ArrayList;
import org.apache.lucene.util._TestUtil; import java.util.Arrays;
import java.util.List;
public class TestBlockJoin extends LuceneTestCase { public class TestBlockJoin extends LuceneTestCase {
@ -149,7 +137,7 @@ public class TestBlockJoin extends LuceneTestCase {
childDoc = s.doc(hits.scoreDocs[0].doc); childDoc = s.doc(hits.scoreDocs[0].doc);
//System.out.println("CHILD = " + childDoc + " docID=" + hits.scoreDocs[0].doc); //System.out.println("CHILD = " + childDoc + " docID=" + hits.scoreDocs[0].doc);
assertEquals("java", childDoc.get("skill")); 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")); assertEquals("Lisa", getParentDoc(r, parentsFilter, hits.scoreDocs[0].doc).get("name"));
// Test with filter on child docs: // Test with filter on child docs:
@ -338,7 +326,7 @@ public class TestBlockJoin extends LuceneTestCase {
if (VERBOSE) { if (VERBOSE) {
StringBuilder sb = new StringBuilder(); 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++) { for(int fieldID=0;fieldID<parentFields.length;fieldID++) {
String s = parentDoc.get("parent" + fieldID); String s = parentDoc.get("parent" + fieldID);
if (s != null) { if (s != null) {
@ -371,7 +359,7 @@ public class TestBlockJoin extends LuceneTestCase {
if (VERBOSE) { if (VERBOSE) {
StringBuilder sb = new StringBuilder(); 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++) { for(int fieldID=0;fieldID<childFields.length;fieldID++) {
String s = joinChildDoc.get("child" + fieldID); String s = joinChildDoc.get("child" + fieldID);
if (s != null) { if (s != null) {
@ -755,7 +743,7 @@ public class TestBlockJoin extends LuceneTestCase {
FieldDoc hit0 = (FieldDoc) hit; FieldDoc hit0 = (FieldDoc) hit;
FieldDoc joinHit0 = (FieldDoc) joinHit; FieldDoc joinHit0 = (FieldDoc) joinHit;
assertEquals(hit0.fields, joinHit0.fields); assertArrayEquals(hit0.fields, joinHit0.fields);
} }
} }