diff --git a/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java b/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java index 99c3292e5e6..bed65336649 100644 --- a/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java +++ b/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java @@ -101,7 +101,7 @@ public abstract class LiveFieldValues implements ReferenceManager.RefreshLi if (value == missingValue) { // Deleted but the deletion is not yet reflected in // the reader: - return (T)null; + return null; } else if (value != null) { return value; } else { 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 d5be334d9e7..4676904ef6e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java @@ -113,9 +113,7 @@ public class TestPrefixCodedTerms extends LuceneTestCase { } Iterator expected = superSet.iterator(); - // NOTE: currenlty using diamond operator on MergedIterator (without explicit Term class) causes - // errors on ecj used for javadoc lint - Iterator actual = new MergedIterator(subs.toArray(new Iterator[0])); + Iterator actual = new MergedIterator<>(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 bbab2b6a549..3f2f6da307a 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,9 +315,7 @@ 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)); } - // NOTE: currenlty using diamond operator on TopGroups (without explicit Term class) causes - // errors on ecj used for javadoc lint - return new TopGroups(mvalTopGroups.groupSort, mvalTopGroups.withinGroupSort, mvalTopGroups.totalHitCount, mvalTopGroups.totalGroupedHitCount, groups.toArray(new GroupDocs[groups.size()]), Float.NaN); + return new TopGroups<>(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 636697322b8..4a011b695b4 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,9 +59,7 @@ public final class MaxFieldValueUpdateProcessorFactory extends FieldValueSubsetU public Collection pickSubset(Collection values) { Collection result = values; try { - // NOTE: max must be put into a temp local in order to avoid ecj errors for javadoc lint - Object max = Collections.max(values); - result = Collections.singletonList(max); + result = Collections.singletonList(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 da18d73f3e4..093fe4945b6 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,9 +59,7 @@ public final class MinFieldValueUpdateProcessorFactory extends FieldValueSubsetU public Collection pickSubset(Collection values) { Collection result = values; try { - // NOTE: min must be put into a temp local in order to avoid ecj errors for javadoc lint - Object min = Collections.min(values); - result = Collections.singletonList(min); + result = Collections.singletonList(Collections.min(values)); } catch (ClassCastException e) { throw new SolrException (BAD_REQUEST,