Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-5950: These 2 hacks are still needed to make the whole thing to compile in Eclipse's compiler (IDE)

Uwe Schindler0f35178beeff
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java
index 4676904ef6e..93031150f7b 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java
@@ -113,7 +113,9 @@ public class TestPrefixCodedTerms extends LuceneTestCase {
}
Iterator<Term> expected = superSet.iterator();
- Iterator<Term> actual = new MergedIterator<>(subs.toArray(new Iterator[0]));
+ // NOTE: currenlty using diamond operator on MergedIterator (without explicit Term class) causes
+ // errors on Eclipse Compiler (ecj) used for javadoc lint
+ Iterator<Term> actual = new MergedIterator<Term>(subs.toArray(new Iterator[0]));
while (actual.hasNext()) {
assertTrue(expected.hasNext());
assertEquals(expected.next(), actual.next());
diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
index 3f2f6da307a..f4ab2c8c023 100644
--- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
+++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
@@ -315,7 +315,9 @@ public class TestGrouping extends LuceneTestCase {
BytesRef groupValue = mvalGd.groupValue.exists() ? ((MutableValueStr) mvalGd.groupValue).value.get() : null;
groups.add(new GroupDocs<>(Float.NaN, mvalGd.maxScore, mvalGd.totalHits, mvalGd.scoreDocs, groupValue, mvalGd.groupSortValues));
}
- return new TopGroups<>(mvalTopGroups.groupSort, mvalTopGroups.withinGroupSort, mvalTopGroups.totalHitCount, mvalTopGroups.totalGroupedHitCount, groups.toArray(new GroupDocs[groups.size()]), Float.NaN);
+ // NOTE: currenlty using diamond operator on MergedIterator (without explicit Term class) causes
+ // errors on Eclipse Compiler (ecj) used for javadoc lint
+ return new TopGroups<BytesRef>(mvalTopGroups.groupSort, mvalTopGroups.withinGroupSort, mvalTopGroups.totalHitCount, mvalTopGroups.totalGroupedHitCount, groups.toArray(new GroupDocs[groups.size()]), Float.NaN);
}
fail();
return null;
diff --git a/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java
index 4a011b695b4..2f311c1f803 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java
@@ -59,7 +59,9 @@ public final class MaxFieldValueUpdateProcessorFactory extends FieldValueSubsetU
public Collection pickSubset(Collection values) {
Collection result = values;
try {
- result = Collections.singletonList(Collections.max(values));
+ // NOTE: the extra cast to Object is needed to prevent compile
+ // errors on Eclipse Compiler (ecj) used for javadoc lint
+ result = Collections.singletonList((Object) Collections.max(values));
} catch (ClassCastException e) {
throw new SolrException
(BAD_REQUEST,
diff --git a/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java
index 093fe4945b6..e8d5a86cef1 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java
@@ -59,7 +59,9 @@ public final class MinFieldValueUpdateProcessorFactory extends FieldValueSubsetU
public Collection pickSubset(Collection values) {
Collection result = values;
try {
- result = Collections.singletonList(Collections.min(values));
+ // NOTE: the extra cast to Object is needed to prevent compile
+ // errors on Eclipse Compiler (ecj) used for javadoc lint
+ result = Collections.singletonList((Object) Collections.min(values));
} catch (ClassCastException e) {
throw new SolrException
(BAD_REQUEST,