From 4658c9652ee790d44f49e2dcb8b873b86254ae2d Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Wed, 13 Nov 2024 07:25:24 +0100 Subject: [PATCH 1/8] Update com.google.errorprone:* to 2.31.0 --- solr/licenses/error_prone_annotations-2.28.0.jar.sha1 | 1 - solr/licenses/error_prone_annotations-2.31.0.jar.sha1 | 1 + versions.lock | 2 +- versions.props | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 solr/licenses/error_prone_annotations-2.28.0.jar.sha1 create mode 100644 solr/licenses/error_prone_annotations-2.31.0.jar.sha1 diff --git a/solr/licenses/error_prone_annotations-2.28.0.jar.sha1 b/solr/licenses/error_prone_annotations-2.28.0.jar.sha1 deleted file mode 100644 index 4839239eabf..00000000000 --- a/solr/licenses/error_prone_annotations-2.28.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -59fc00087ce372de42e394d2c789295dff2d19f0 diff --git a/solr/licenses/error_prone_annotations-2.31.0.jar.sha1 b/solr/licenses/error_prone_annotations-2.31.0.jar.sha1 new file mode 100644 index 00000000000..1fa88710c6d --- /dev/null +++ b/solr/licenses/error_prone_annotations-2.31.0.jar.sha1 @@ -0,0 +1 @@ +c3ba307b915d6d506e98ffbb49e6d2d12edad65b diff --git a/versions.lock b/versions.lock index 04ea37b692a..17ce70225e3 100644 --- a/versions.lock +++ b/versions.lock @@ -46,7 +46,7 @@ com.google.cloud:google-cloud-core-grpc:2.40.0 (1 constraints: 1a1001a6) com.google.cloud:google-cloud-core-http:2.40.0 (1 constraints: 1a1001a6) com.google.cloud:google-cloud-storage:2.40.1 (2 constraints: cf1cc626) com.google.code.gson:gson:2.11.0 (6 constraints: 0c550bc0) -com.google.errorprone:error_prone_annotations:2.28.0 (15 constraints: a5c51259) +com.google.errorprone:error_prone_annotations:2.31.0 (15 constraints: a5c51259) com.google.guava:failureaccess:1.0.2 (2 constraints: fb19bf37) com.google.guava:guava:33.1.0-jre (27 constraints: 698fe64d) com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (2 constraints: 4b35b0a0) diff --git a/versions.props b/versions.props index 286700c1d75..946b3d97e6d 100644 --- a/versions.props +++ b/versions.props @@ -10,7 +10,7 @@ com.github.ben-manes.caffeine:caffeine=3.1.8 com.github.spotbugs:*=4.8.6 com.github.stephenc.jcip:jcip-annotations=1.0-1 com.google.cloud:google-cloud-bom=0.224.0 -com.google.errorprone:*=2.23.0 +com.google.errorprone:*=2.31.0 com.google.guava:guava=32.1.3-jre com.google.re2j:re2j=1.7 com.j256.simplemagic:simplemagic=1.17 From 93f2f73cdae0580db853375d5c672d4c5624c09e Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Wed, 13 Nov 2024 08:07:45 +0100 Subject: [PATCH 2/8] Remove impossible null comparison This check is impossible and will always fail with an IllegalArgumentException if algorithmString is invalid. The same IllegalArgumentException is also thrown in the else block, so the output is the same. --- .../update/processor/ClassificationUpdateProcessorFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java index 1d0e57bc3e9..7f599682eaf 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java @@ -92,8 +92,7 @@ public void init(final NamedList args) { String algorithmString = params.get(ALGORITHM_PARAM); Algorithm classificationAlgorithm; try { - if (algorithmString == null - || Algorithm.valueOf(algorithmString.toUpperCase(Locale.ROOT)) == null) { + if (algorithmString == null) { classificationAlgorithm = DEFAULT_ALGORITHM; } else { classificationAlgorithm = Algorithm.valueOf(algorithmString.toUpperCase(Locale.ROOT)); From 88441129e780f6a42e3b44aa7759119aaacaee2a Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Wed, 13 Nov 2024 08:08:00 +0100 Subject: [PATCH 3/8] Suppress wanted method references --- .../java/org/apache/solr/pkg/PackageListeningClassLoader.java | 3 +++ .../src/java/org/apache/solr/common/cloud/SolrZkClient.java | 3 +++ .../solr/client/solrj/request/TestUpdateRequestCodec.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/solr/core/src/java/org/apache/solr/pkg/PackageListeningClassLoader.java b/solr/core/src/java/org/apache/solr/pkg/PackageListeningClassLoader.java index 65d46edd5ad..272de544b6e 100644 --- a/solr/core/src/java/org/apache/solr/pkg/PackageListeningClassLoader.java +++ b/solr/core/src/java/org/apache/solr/pkg/PackageListeningClassLoader.java @@ -105,6 +105,9 @@ public SolrPackageLoader.SolrPackage.Version findPackageVersion( return theVersion; } + // Allow method reference to return a reference to a functional interface (Mapwriter), + // rather than a reference to a PgkVersion object + @SuppressWarnings("UnnecessaryMethodReference") @Override public MapWriter getPackageVersion(PluginInfo.ClassName cName) { if (cName.pkg == null) return null; diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java index 9ae720cb180..4c765917bae 100644 --- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java +++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java @@ -89,6 +89,9 @@ public class SolrZkClient implements Closeable { private Compressor compressor; private int minStateByteLenForCompression; + // Allow method reference to return a reference to a functional interface (Mapwriter), + // rather than a reference to a ZkMetrics object + @SuppressWarnings("UnnecessaryMethodReference") public MapWriter getMetrics() { return metrics::writeMap; } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestUpdateRequestCodec.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestUpdateRequestCodec.java index e8c72a52b44..ef24375ca16 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestUpdateRequestCodec.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestUpdateRequestCodec.java @@ -110,6 +110,9 @@ public void simple() throws IOException { assertEquals("b", updateUnmarshalled.getParams().get("a")); } + // Allow method reference to return a reference to a functional interface (Iterable), + // rather than a reference to a List object + @SuppressWarnings("UnnecessaryMethodReference") @Test public void testIterable() throws IOException { final List values = new ArrayList<>(); From 87399ec26792e31345c15d4c663f9e06aaff8088 Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Wed, 13 Nov 2024 08:12:23 +0100 Subject: [PATCH 4/8] Make classes static This fixes ClassCanBeStatic warnings --- .../ltr/src/java/org/apache/solr/ltr/feature/Feature.java | 6 +++--- .../org/apache/solr/ltr/feature/OriginalScoreFeature.java | 2 +- .../src/java/org/apache/solr/ltr/feature/SolrFeature.java | 2 +- .../src/java/org/apache/solr/cloud/ZkTestServer.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/Feature.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/Feature.java index f07f624f3f1..f3fe61c3fb5 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/Feature.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/Feature.java @@ -302,7 +302,7 @@ public String toString() { } /** A 'recipe' for computing a feature */ - public abstract class FeatureScorer extends Scorer { + public abstract static class FeatureScorer extends Scorer { protected final String name; private DocInfo docInfo; @@ -342,7 +342,7 @@ public DocIdSetIterator iterator() { * A FeatureScorer that contains a Scorer, which it delegates to where * appropriate. */ - public abstract class FilterFeatureScorer extends FeatureScorer { + public abstract static class FilterFeatureScorer extends FeatureScorer { protected final Scorer in; @@ -380,7 +380,7 @@ public float getMaxScore(int upTo) throws IOException { * Default FeatureScorer class that returns the score passed in. Can be used as a simple * ValueFeature, or to return a default scorer in case an underlying feature's scorer is null. */ - public class ValueFeatureScorer extends FeatureScorer { + public static class ValueFeatureScorer extends FeatureScorer { float constScore; public ValueFeatureScorer(FeatureWeight weight, float constScore, DocIdSetIterator itr) { diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/OriginalScoreFeature.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/OriginalScoreFeature.java index a74e930641b..e2b4e8d93ad 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/OriginalScoreFeature.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/OriginalScoreFeature.java @@ -91,7 +91,7 @@ public FeatureScorer scorer(LeafReaderContext context) throws IOException { return new OriginalScoreScorer(this, originalScorer); } - public class OriginalScoreScorer extends FilterFeatureScorer { + public static class OriginalScoreScorer extends FilterFeatureScorer { public OriginalScoreScorer(FeatureWeight weight, Scorer originalScorer) { super(weight, originalScorer); diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java index 2162dfd3ecb..5c696b6f96f 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java @@ -234,7 +234,7 @@ public FeatureScorer scorer(LeafReaderContext context) throws IOException { } /** Scorer for a SolrFeature */ - public class SolrFeatureScorer extends FilterFeatureScorer { + public static class SolrFeatureScorer extends FilterFeatureScorer { public SolrFeatureScorer(FeatureWeight weight, Scorer solrScorer) { super(weight, solrScorer); diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java index 8bd7396c7a7..2041760c0d4 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java @@ -266,7 +266,7 @@ private void updateForFire(WatchedEvent event) { } } - private class TestZKDatabase extends ZKDatabase { + private static class TestZKDatabase extends ZKDatabase { private final WatchLimiter limiter; From 3442dce234e86c92de0a44cbf68a27e8d1a4b79a Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Wed, 13 Nov 2024 08:31:00 +0100 Subject: [PATCH 5/8] Remove null checks for primitive data types qTime is a (primitive) long and is always 0 by default. This could be also fixed by changing qTime type to Long. In the case of fromHumanReadableUnits(), the method will throw an AssertionError or NumberFormatException for invalid types, and cannot return a (primitive) double that is null. --- .../org/apache/solr/handler/admin/IndexSizeEstimatorTest.java | 2 -- .../org/apache/solr/handler/admin/api/ReloadCoreAPITest.java | 1 - .../org/apache/solr/handler/admin/api/UnloadCoreAPITest.java | 1 - 3 files changed, 4 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java b/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java index e175497aa36..5523ad23c15 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java @@ -227,8 +227,6 @@ public void testIntegration() throws Exception { (k, v) -> { double size = fromHumanReadableUnits((String) v); double sampledSize = fromHumanReadableUnits((String) sampledFieldsBySize.get(k)); - assertNotNull( - "sampled size missing for field " + k + " in " + sampledFieldsBySize, sampledSize); double delta = size * 0.5; assertEquals("sampled size of " + k + " is wildly off", size, sampledSize, delta); }); diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/ReloadCoreAPITest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/ReloadCoreAPITest.java index 304717a167a..fc73c6781f9 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/api/ReloadCoreAPITest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/api/ReloadCoreAPITest.java @@ -57,7 +57,6 @@ public void setUp() throws Exception { public void testValidReloadCoreAPIResponse() throws Exception { SolrJerseyResponse response = reloadCoreAPI.reloadCore(coreName, new ReloadCoreRequestBody()); assertEquals(0, response.responseHeader.status); - assertNotNull(response.responseHeader.qTime); } @Test diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/UnloadCoreAPITest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/UnloadCoreAPITest.java index d2dcc732b2c..c823f33dea1 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/api/UnloadCoreAPITest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/api/UnloadCoreAPITest.java @@ -56,7 +56,6 @@ public void setUp() throws Exception { public void testValidUnloadCoreAPIResponse() throws Exception { SolrJerseyResponse response = unloadCoreAPI.unloadCore(coreName, getUnloadCoreRequestBodyObj()); assertEquals(0, response.responseHeader.status); - assertNotNull(response.responseHeader.qTime); } @Test From e0fc24061db42ee9fd8d8e1b300b9ac7fa6d7181 Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Wed, 13 Nov 2024 09:27:11 +0100 Subject: [PATCH 6/8] Update comment of deprecated pattern --- gradle/validation/error-prone.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle index 00e14ed0eab..273842ba16d 100644 --- a/gradle/validation/error-prone.gradle +++ b/gradle/validation/error-prone.gradle @@ -236,7 +236,7 @@ allprojects { prj -> // '-Xep:ThrowIfUncheckedKnownChecked:OFF', // we don't use this annotation '-Xep:ThrowNull:ERROR', '-Xep:TreeToString:ERROR', - // '-Xep:TruthSelfEquals:OFF', // we don't use truth + // '-Xep:SelfAssertion:OFF', // we don't use truth '-Xep:TryFailThrowable:ERROR', '-Xep:TypeParameterQualifier:ERROR', '-Xep:UnicodeDirectionalityCharacters:ERROR', From 463e1d41d9523ba7d7d825afeca1659666257f1a Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Wed, 13 Nov 2024 12:56:07 +0100 Subject: [PATCH 7/8] Add new error-prone rules Add new error-prone rules to the list without enabling them. --- gradle/validation/error-prone.gradle | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle index 273842ba16d..02a9e54c660 100644 --- a/gradle/validation/error-prone.gradle +++ b/gradle/validation/error-prone.gradle @@ -179,6 +179,7 @@ allprojects { prj -> '-Xep:MathRoundIntLong:ERROR', // '-Xep:MislabeledAndroidString:OFF', // we don't use android '-Xep:MisplacedScopeAnnotations:ERROR', + // '-Xep:MissingRuntimeRetention:ERROR', // todo check if useful or comment why not // '-Xep:MissingSuperCall:OFF', // we don't use this annotation // '-Xep:MissingTestCall:OFF', // we don't use this annotation '-Xep:MisusedDayOfYear:ERROR', @@ -218,12 +219,15 @@ allprojects { prj -> '-Xep:RandomCast:ERROR', '-Xep:RandomModInteger:ERROR', // '-Xep:RectIntersectReturnValueIgnored:OFF', // we don't use android + // '-Xep:RedundantSetterCall:ERROR', // todo check if useful or comment why not // '-Xep:RequiredModifiers:OFF', // we don't use this annotation // '-Xep:RestrictedApiChecker:OFF', // we don't use this annotation // '-Xep:ReturnValueIgnored:OFF', // todo there are problems that should be fixed + // '-Xep:SelfAssertion:ERROR', // todo check if useful or comment why not '-Xep:SelfAssignment:ERROR', '-Xep:SelfComparison:ERROR', '-Xep:SelfEquals:ERROR', + // '-Xep:SetUnrecognized:ERROR', // todo check if useful or comment why not // '-Xep:ShouldHaveEvenArgs:OFF', // we don't use truth '-Xep:SizeGreaterThanOrEqualsZero:ERROR', '-Xep:StreamToString:ERROR', @@ -265,6 +269,7 @@ allprojects { prj -> '-Xep:AssertionFailureIgnored:WARN', '-Xep:AssistedInjectAndInjectOnSameConstructor:WARN', '-Xep:AttemptedNegativeZero:WARN', + // '-Xep:AutoValueBoxedValues:WARN', // todo check if useful or comment why not // '-Xep:AutoValueFinalMethods:OFF', // we don't use autovalue // '-Xep:AutoValueImmutableFields:OFF', // we don't use autovalue // '-Xep:AutoValueSubclassLeaked:OFF', // we don't use autovalue @@ -285,6 +290,7 @@ allprojects { prj -> '-Xep:ChainedAssertionLosesContext:WARN', '-Xep:CharacterGetNumericValue:WARN', '-Xep:ClassCanBeStatic:WARN', + // '-Xep:ClassInitializationDeadlock:WARN', // todo check if useful or comment why not '-Xep:ClassNewInstance:WARN', // '-Xep:CloseableProvides:OFF', // we don't use this annotation '-Xep:ClosingStandardOutputStreams:WARN', @@ -296,6 +302,8 @@ allprojects { prj -> '-Xep:DateChecker:WARN', '-Xep:DateFormatConstant:WARN', // '-Xep:DefaultCharset:OFF', // we have forbiddenapis for that + //'-Xep:DeeplyNested:WARN', // todo check if useful or comment why not + //'-Xep:DefaultLocale:WARN', // todo check if useful or comment why not '-Xep:DefaultPackage:WARN', '-Xep:DeprecatedVariable:WARN', '-Xep:DirectInvocationOnMock:WARN', @@ -309,6 +317,7 @@ allprojects { prj -> '-Xep:EmptyBlockTag:WARN', // '-Xep:EmptyCatch:OFF', // todo check if useful or comment why not - might be handled by ECJ? // '-Xep:EmptySetMultibindingContributions:OFF', // we don't use this annotation + // '-Xep:EnumOrdinal:WARN', // todo check if useful or comment why not '-Xep:EqualsGetClass:WARN', '-Xep:EqualsIncompatibleType:WARN', '-Xep:EqualsUnsafeCast:WARN', @@ -330,6 +339,7 @@ allprojects { prj -> // '-Xep:FragmentNotInstantiable:OFF', // we don't use android // '-Xep:FutureReturnValueIgnored:OFF', // todo there are problems that should be fixed '-Xep:GetClassOnEnum:WARN', + // '-Xep:GuiceNestedCombine:WARN', // todo check if useful or comment why not '-Xep:HidingField:WARN', '-Xep:ICCProfileGetInstance:WARN', '-Xep:IdentityHashMapUsage:WARN', @@ -383,6 +393,7 @@ allprojects { prj -> '-Xep:JodaPlusMinusLong:WARN', '-Xep:JodaTimeConverterManager:WARN', '-Xep:JodaWithDurationAddedLong:WARN', + // '-Xep:JUnitIncompatibleType:WARN', // todo check if useful or comment why not // '-Xep:LabelledBreakTarget:OFF', // stylistic '-Xep:LiteEnumValueOf:WARN', '-Xep:LiteProtoToString:WARN', @@ -403,10 +414,12 @@ allprojects { prj -> // '-Xep:MissingSummary:OFF', // style preference that we don't want to enforce // '-Xep:MixedMutabilityReturnType:OFF', // todo check if useful or comment why not '-Xep:MockNotUsedInProduction:WARN', + // '-Xep:MockitoDoSetup:WARN', // todo check if useful or comment why not '-Xep:ModifiedButNotUsed:WARN', '-Xep:ModifyCollectionInEnhancedForLoop:WARN', '-Xep:ModifySourceCollectionInStream:WARN', '-Xep:MultimapKeys:WARN', + // '-Xep:MultipleNullnessAnnotations:WARN', // todo check if useful or comment why not '-Xep:MultipleParallelOrSequentialCalls:WARN', '-Xep:MultipleUnaryOperatorsInMethodCall:WARN', // '-Xep:MutableGuiceModule:OFF', // we don't use guice @@ -428,7 +441,9 @@ allprojects { prj -> '-Xep:NullableOptional:WARN', // '-Xep:NullablePrimitive:OFF', // we don't use this annotation // '-Xep:NullablePrimitiveArray:OFF', // we don't use this annotation + // '-Xep:NullableTypeParameter:WARN', // todo check if useful or comment why not // '-Xep:NullableVoid:OFF', // we don't use this annotation + // '-Xep:NullableWildcard:WARN', // todo check if useful or comment why not '-Xep:ObjectEqualsForPrimitives:WARN', // '-Xep:ObjectToString:OFF', // todo check if useful or comment why not '-Xep:ObjectsHashCodePrimitive:WARN', @@ -442,6 +457,7 @@ allprojects { prj -> '-Xep:Overrides:WARN', // '-Xep:OverridesGuiceInjectableMethod:OFF', // we don't use guice '-Xep:ParameterName:WARN', + // '-Xep:PatternMatchingInstanceof:WARN', // todo check if useful or comment why not '-Xep:PreconditionsCheckNotNullRepeated:WARN', '-Xep:PrimitiveAtomicReference:WARN', '-Xep:ProtectedMembersInFinalClass:WARN', @@ -459,6 +475,7 @@ allprojects { prj -> // '-Xep:SameNameButDifferent:OFF', // todo check if useful or comment why not '-Xep:SelfAlwaysReturnsThis:WARN', // '-Xep:ShortCircuitBoolean:OFF', // todo check if useful or comment why not + // '-Xep:StatementSwitchToExpressionSwitch:WARN', // todo check if useful or comment why not // '-Xep:StaticAssignmentInConstructor:OFF', // we assign SolrTestCaseJ4.configString in many tests, difficult to untangle '-Xep:StaticAssignmentOfThrowable:WARN', // '-Xep:StaticGuardedByInstance:OFF', // todo check if useful or comment why not @@ -469,9 +486,12 @@ allprojects { prj -> '-Xep:StringCharset:WARN', '-Xep:StringFormatWithLiteral:WARN', // '-Xep:StringSplitter:OFF', // todo check if useful or comment why not - might be able to use forbidden-apis for this? + // '-Xep:SunApi:WARN', // todo check if useful or comment why not + // '-Xep:SuperCallToObjectMethod:WARN', // todo check if useful or comment why not '-Xep:SuperEqualsIsObjectEquals:WARN', // '-Xep:SwigMemoryLeak:OFF', // we don't use swig // '-Xep:SynchronizeOnNonFinalField:OFF', // todo check if useful or comment why not + // '-Xep:SystemConsoleNull:WARN', // todo check if useful or comment why not // '-Xep:ThreadJoinLoop:OFF', // todo check if useful or comment why not // '-Xep:ThreadLocalUsage:OFF', // todo check if useful or comment why not // '-Xep:ThreadPriorityCheck:OFF', // todo check if useful or comment why not @@ -493,6 +513,7 @@ allprojects { prj -> // '-Xep:UnicodeEscape:OFF', // can't enable since Lucene/Solr tests use unicode a bunch // '-Xep:UnnecessaryAssignment:OFF', // we don't use these annotations '-Xep:UnnecessaryAsync:WARN', + // '-Xep:UnnecessaryBreakInSwitch:WARN', // todo check if useful or comment why not '-Xep:UnnecessaryLambda:WARN', '-Xep:UnnecessaryLongToIntConversion:WARN', '-Xep:UnnecessaryMethodInvocationMatcher:WARN', @@ -513,6 +534,7 @@ allprojects { prj -> // '-Xep:UseBinds:OFF', // we don't use this annotation // '-Xep:UseCorrectAssertInTests:OFF', // we inherit from LuceneTestCase which extends Assert '-Xep:VariableNameSameAsType:WARN', + // '-Xep:VoidUsed:WARN', // todo check if useful or comment why not // '-Xep:WaitNotInLoop:OFF', // todo check if useful or comment why not // '-Xep:WakelockReleasedDangerously:OFF', // we don't use android // '-Xep:WithSignatureDiscouraged:OFF', // we aren't using this error-prone internal api From f2b67d6e74ca2711402a9db03d92c425b481e373 Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Wed, 13 Nov 2024 14:36:02 +0100 Subject: [PATCH 8/8] Remove duplicate error-prone rule --- gradle/validation/error-prone.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle index 02a9e54c660..647ebdeb4fb 100644 --- a/gradle/validation/error-prone.gradle +++ b/gradle/validation/error-prone.gradle @@ -240,7 +240,6 @@ allprojects { prj -> // '-Xep:ThrowIfUncheckedKnownChecked:OFF', // we don't use this annotation '-Xep:ThrowNull:ERROR', '-Xep:TreeToString:ERROR', - // '-Xep:SelfAssertion:OFF', // we don't use truth '-Xep:TryFailThrowable:ERROR', '-Xep:TypeParameterQualifier:ERROR', '-Xep:UnicodeDirectionalityCharacters:ERROR',