mirror of https://github.com/apache/lucene.git
LUCENE-3850: Removed some of the rawtypes compiler warnings
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1298315 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
540967c9b4
commit
5f3053fa09
|
@ -120,7 +120,7 @@ public abstract class AbstractSecondPassGroupingCollector<GROUP_VALUE_TYPE> exte
|
|||
}
|
||||
|
||||
public TopGroups<GROUP_VALUE_TYPE> getTopGroups(int withinGroupOffset) {
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({"unchecked","rawtypes"})
|
||||
final GroupDocs<GROUP_VALUE_TYPE>[] groupDocsResult = (GroupDocs<GROUP_VALUE_TYPE>[]) new GroupDocs[groups.size()];
|
||||
|
||||
int groupIDX = 0;
|
||||
|
|
|
@ -18,25 +18,14 @@ package org.apache.lucene.search.grouping;
|
|||
*/
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.lucene.index.AtomicReaderContext;
|
||||
import org.apache.lucene.index.IndexWriter; // javadocs
|
||||
import org.apache.lucene.search.Collector;
|
||||
import org.apache.lucene.search.DocIdSetIterator;
|
||||
import org.apache.lucene.search.FieldComparator;
|
||||
import org.apache.lucene.search.Filter;
|
||||
import org.apache.lucene.search.Scorer;
|
||||
import org.apache.lucene.search.Sort;
|
||||
import org.apache.lucene.search.SortField;
|
||||
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.index.IndexWriter;
|
||||
import org.apache.lucene.search.*;
|
||||
import org.apache.lucene.util.ArrayUtil;
|
||||
import org.apache.lucene.util.PriorityQueue;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/** BlockGroupingCollector performs grouping with a
|
||||
* single pass collector, as long as you are grouping by a
|
||||
* doc block field, ie all documents sharing a given group
|
||||
|
@ -316,7 +305,7 @@ public class BlockGroupingCollector extends Collector {
|
|||
|
||||
final FakeScorer fakeScorer = new FakeScorer();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({"unchecked","rawtypes"})
|
||||
final GroupDocs<Object>[] groups = new GroupDocs[groupQueue.size() - groupOffset];
|
||||
for(int downTo=groupQueue.size()-groupOffset-1;downTo>=0;downTo--) {
|
||||
final OneGroup og = groupQueue.pop();
|
||||
|
|
|
@ -167,7 +167,7 @@ public class SearchGroup<GROUP_VALUE_TYPE> {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({"unchecked","rawtypes"})
|
||||
public int compare(MergedGroup<T> group, MergedGroup<T> other) {
|
||||
if (group == other) {
|
||||
return 0;
|
||||
|
@ -202,7 +202,7 @@ public class SearchGroup<GROUP_VALUE_TYPE> {
|
|||
groupsSeen = new HashMap<T,MergedGroup<T>>();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({"unchecked","rawtypes"})
|
||||
private void updateNextGroup(int topN, ShardIter<T> shard) {
|
||||
while(shard.iter.hasNext()) {
|
||||
final SearchGroup<T> group = shard.next();
|
||||
|
|
|
@ -111,7 +111,7 @@ public class TopGroups<GROUP_VALUE_TYPE> {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({"unchecked","rawtypes"})
|
||||
final GroupDocs<T>[] mergedGroupDocs = new GroupDocs[numGroups];
|
||||
|
||||
final TopDocs[] shardTopDocs = new TopDocs[shardGroups.length];
|
||||
|
|
|
@ -18,11 +18,10 @@ package org.apache.lucene.search.grouping.term;
|
|||
*/
|
||||
|
||||
import org.apache.lucene.index.AtomicReaderContext;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.apache.lucene.search.*;
|
||||
import org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector;
|
||||
import org.apache.lucene.util.SentinelIntSet;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.apache.lucene.util.SentinelIntSet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
@ -60,7 +59,7 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHead
|
|||
* @return an <code>AbstractAllGroupHeadsCollector</code> instance based on the supplied arguments
|
||||
* @throws IOException If I/O related errors occur
|
||||
*/
|
||||
public static AbstractAllGroupHeadsCollector create(String groupField, Sort sortWithinGroup) throws IOException {
|
||||
public static AbstractAllGroupHeadsCollector<?> create(String groupField, Sort sortWithinGroup) throws IOException {
|
||||
return create(groupField, sortWithinGroup, DEFAULT_INITIAL_SIZE);
|
||||
}
|
||||
|
||||
|
@ -76,7 +75,7 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHead
|
|||
* @return an <code>AbstractAllGroupHeadsCollector</code> instance based on the supplied arguments
|
||||
* @throws IOException If I/O related errors occur
|
||||
*/
|
||||
public static AbstractAllGroupHeadsCollector create(String groupField, Sort sortWithinGroup, int initialSize) throws IOException {
|
||||
public static AbstractAllGroupHeadsCollector<?> create(String groupField, Sort sortWithinGroup, int initialSize) throws IOException {
|
||||
boolean sortAllScore = true;
|
||||
boolean sortAllFieldValue = true;
|
||||
|
||||
|
@ -157,7 +156,7 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHead
|
|||
public void setScorer(Scorer scorer) throws IOException {
|
||||
this.scorer = scorer;
|
||||
for (GroupHead groupHead : groups.values()) {
|
||||
for (FieldComparator comparator : groupHead.comparators) {
|
||||
for (FieldComparator<?> comparator : groupHead.comparators) {
|
||||
comparator.setScorer(scorer);
|
||||
}
|
||||
}
|
||||
|
@ -165,8 +164,9 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHead
|
|||
|
||||
class GroupHead extends AbstractAllGroupHeadsCollector.GroupHead<BytesRef> {
|
||||
|
||||
final FieldComparator[] comparators;
|
||||
final FieldComparator<?>[] comparators;
|
||||
|
||||
@SuppressWarnings({"unchecked","rawtypes"})
|
||||
private GroupHead(BytesRef groupValue, Sort sort, int doc) throws IOException {
|
||||
super(groupValue, doc + readerContext.docBase);
|
||||
final SortField[] sortFields = sort.getSort();
|
||||
|
@ -184,7 +184,7 @@ public abstract class TermAllGroupHeadsCollector<GH extends AbstractAllGroupHead
|
|||
}
|
||||
|
||||
public void updateDocHead(int doc) throws IOException {
|
||||
for (FieldComparator comparator : comparators) {
|
||||
for (FieldComparator<?> comparator : comparators) {
|
||||
comparator.copy(0, doc);
|
||||
comparator.setBottom(0);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class TermSecondPassGroupingCollector extends AbstractSecondPassGroupingC
|
|||
private final BytesRef spareBytesRef = new BytesRef();
|
||||
private final String groupField;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public TermSecondPassGroupingCollector(String groupField, Collection<SearchGroup<BytesRef>> groups, Sort groupSort, Sort withinGroupSort,
|
||||
int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields)
|
||||
throws IOException {
|
||||
|
|
Loading…
Reference in New Issue