mirror of https://github.com/apache/lucene.git
Nicer solution to generic array creation (still problematic in Java 6, but correct in Java 7 if done this way)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1366832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8318dff526
commit
c6455c6da2
|
@ -160,11 +160,15 @@ public class TestSubScorerFreqs extends LuceneTestCase {
|
||||||
query.add(inner, Occur.MUST);
|
query.add(inner, Occur.MUST);
|
||||||
query.add(aQuery, Occur.MUST);
|
query.add(aQuery, Occur.MUST);
|
||||||
query.add(dQuery, Occur.MUST);
|
query.add(dQuery, Occur.MUST);
|
||||||
@SuppressWarnings({"unchecked","rawtypes"}) Set<String>[] occurList = new Set[] {
|
|
||||||
|
// Only needed in Java6; Java7+ has a @SafeVarargs annotated Arrays#asList()!
|
||||||
|
// see http://docs.oracle.com/javase/7/docs/api/java/lang/SafeVarargs.html
|
||||||
|
@SuppressWarnings("unchecked") final Iterable<Set<String>> occurList = Arrays.asList(
|
||||||
Collections.singleton("MUST"),
|
Collections.singleton("MUST"),
|
||||||
new HashSet<String>(Arrays.asList("MUST", "SHOULD"))
|
new HashSet<String>(Arrays.asList("MUST", "SHOULD"))
|
||||||
};
|
);
|
||||||
for (Set<String> occur : occurList) {
|
|
||||||
|
for (final Set<String> occur : occurList) {
|
||||||
CountingCollector c = new CountingCollector(TopScoreDocCollector.create(
|
CountingCollector c = new CountingCollector(TopScoreDocCollector.create(
|
||||||
10, true), occur);
|
10, true), occur);
|
||||||
s.search(query, null, c);
|
s.search(query, null, c);
|
||||||
|
|
Loading…
Reference in New Issue