diff --git a/core/src/test/java/org/apache/druid/timeline/partition/NoneShardSpecTest.java b/core/src/test/java/org/apache/druid/timeline/partition/NoneShardSpecTest.java index 04a519dc547..a27777311db 100644 --- a/core/src/test/java/org/apache/druid/timeline/partition/NoneShardSpecTest.java +++ b/core/src/test/java/org/apache/druid/timeline/partition/NoneShardSpecTest.java @@ -56,6 +56,6 @@ public class NoneShardSpecTest final String jsonStr = "{\"type\": \"none\",\"partitionNum\": 2}"; ObjectMapper mapper = new TestObjectMapper(); final ShardSpec noneShardSpec = mapper.readValue(jsonStr, ShardSpec.class); - noneShardSpec.equals(NoneShardSpec.instance()); + Assert.assertEquals(NoneShardSpec.instance(), noneShardSpec); } } diff --git a/extensions-contrib/thrift-extensions/pom.xml b/extensions-contrib/thrift-extensions/pom.xml index 07b8edb3939..c68b7f48eee 100644 --- a/extensions-contrib/thrift-extensions/pom.xml +++ b/extensions-contrib/thrift-extensions/pom.xml @@ -183,24 +183,4 @@ - - - - strict - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - -Xep:MissingOverride:WARN - - - - - - - diff --git a/extensions-core/avro-extensions/pom.xml b/extensions-core/avro-extensions/pom.xml index adb64bfa5f4..c1f1af67858 100644 --- a/extensions-core/avro-extensions/pom.xml +++ b/extensions-core/avro-extensions/pom.xml @@ -324,24 +324,4 @@ - - - - strict - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - -Xep:MissingOverride:WARN - - - - - - - diff --git a/extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/RetryIfUnauthorizedResponseHandler.java b/extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/RetryIfUnauthorizedResponseHandler.java index 9f3b732fc2c..c71fa715c34 100644 --- a/extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/RetryIfUnauthorizedResponseHandler.java +++ b/extensions-core/druid-kerberos/src/main/java/org/apache/druid/security/kerberos/RetryIfUnauthorizedResponseHandler.java @@ -39,6 +39,7 @@ public class RetryIfUnauthorizedResponseHandler } @Override + @SuppressWarnings("ReturnValueIgnored") public ClientResponse> handleResponse( HttpResponse httpResponse, TrafficCop trafficCop @@ -55,6 +56,7 @@ public class RetryIfUnauthorizedResponseHandler } @Override + @SuppressWarnings("ReturnValueIgnored") public ClientResponse> handleChunk( ClientResponse> clientResponse, HttpChunk httpChunk, diff --git a/extensions-core/protobuf-extensions/pom.xml b/extensions-core/protobuf-extensions/pom.xml index 5c2ac8f7f9d..87c3ec4e896 100644 --- a/extensions-core/protobuf-extensions/pom.xml +++ b/extensions-core/protobuf-extensions/pom.xml @@ -198,23 +198,4 @@ - - - strict - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - -Xep:MissingOverride:WARN - - - - - - - diff --git a/licenses.yaml b/licenses.yaml index 88f6bf2206d..dee7ac3475a 100644 --- a/licenses.yaml +++ b/licenses.yaml @@ -350,7 +350,7 @@ name: Error Prone Annotations license_category: binary module: java-core license_name: Apache License version 2.0 -version: 2.7.1 +version: 2.8.0 libraries: - com.google.errorprone: error_prone_annotations diff --git a/pom.xml b/pom.xml index 6313a878212..1bef256e7b0 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ 1.3.0 10.14.2.0 4.0.0 - 2.7.1 + 2.8.0 8.5.4 16.0.1 4.1.0 @@ -1694,8 +1694,7 @@ false -XDcompilePolicy=simple - - -Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-(test-)?sources/.* -XepDisableWarningsInGeneratedCode -Xep:ClassCanBeStatic:ERROR -Xep:PreconditionsInvalidPlaceholder:ERROR -Xep:MissingOverride:ERROR -Xep:DefaultCharset:ERROR -Xep:QualifierOrScopeOnInjectMethod:ERROR -Xep:AssistedInjectAndInjectOnSameConstructor -Xep:AutoFactoryAtInject -Xep:ClassName -Xep:ComparisonContractViolated -Xep:DepAnn -Xep:DivZero -Xep:EmptyIf -Xep:InjectInvalidTargetingOnScopingAnnotation -Xep:InjectMoreThanOneQualifier -Xep:InjectScopeAnnotationOnInterfaceOrAbstractClass -Xep:InjectScopeOrQualifierAnnotationRetention -Xep:InjectedConstructorAnnotations -Xep:InsecureCryptoUsage -Xep:JMockTestWithoutRunWithOrRuleAnnotation -Xep:JavaxInjectOnFinalField -Xep:LockMethodChecker -Xep:LongLiteralLowerCaseSuffix -Xep:NoAllocation -Xep:NonRuntimeAnnotation -Xep:NumericEquality -Xep:ProtoStringFieldReferenceEquality -Xep:UnlockMethod -Xep:LongFloatConversion:OFF + -Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-(test-)?sources/.* -XepDisableWarningsInGeneratedCode -Xep:ClassCanBeStatic:ERROR -Xep:PreconditionsInvalidPlaceholder:ERROR -Xep:MissingOverride:ERROR -Xep:DefaultCharset:ERROR -Xep:QualifierOrScopeOnInjectMethod:ERROR -Xep:AssistedInjectAndInjectOnSameConstructor -Xep:AutoFactoryAtInject -Xep:ClassName -Xep:ComparisonContractViolated -Xep:DepAnn -Xep:DivZero -Xep:EmptyIf -Xep:InjectInvalidTargetingOnScopingAnnotation -Xep:InjectMoreThanOneQualifier -Xep:InjectScopeAnnotationOnInterfaceOrAbstractClass -Xep:InjectScopeOrQualifierAnnotationRetention -Xep:InjectedConstructorAnnotations -Xep:InsecureCryptoUsage -Xep:JMockTestWithoutRunWithOrRuleAnnotation -Xep:JavaxInjectOnFinalField -Xep:LockMethodChecker -Xep:LongLiteralLowerCaseSuffix -Xep:NoAllocation -Xep:NonRuntimeAnnotation -Xep:NumericEquality -Xep:ProtoStringFieldReferenceEquality -Xep:UnlockMethod diff --git a/processing/src/test/java/org/apache/druid/segment/IndexIOTest.java b/processing/src/test/java/org/apache/druid/segment/IndexIOTest.java index b6a9155566b..1911aa6bc5b 100644 --- a/processing/src/test/java/org/apache/druid/segment/IndexIOTest.java +++ b/processing/src/test/java/org/apache/druid/segment/IndexIOTest.java @@ -361,7 +361,7 @@ public class IndexIOTest extends InitializedNullHandlingTest queryableIndex.getDimensionHandlers(); List columnNames = queryableIndex.getColumnNames(); for (String columnName : columnNames) { - queryableIndex.getColumnHolder(columnName).toString(); + Assert.assertNotNull(queryableIndex.getColumnHolder(columnName).toString()); } } catch (Exception ex) { diff --git a/server/src/test/java/org/apache/druid/client/ImmutableDruidDataSourceTest.java b/server/src/test/java/org/apache/druid/client/ImmutableDruidDataSourceTest.java index bf8e4544e53..36bf4e688ef 100644 --- a/server/src/test/java/org/apache/druid/client/ImmutableDruidDataSourceTest.java +++ b/server/src/test/java/org/apache/druid/client/ImmutableDruidDataSourceTest.java @@ -29,6 +29,7 @@ import org.apache.druid.java.util.common.Intervals; import org.apache.druid.test.utils.ImmutableDruidDataSourceTestUtils; import org.apache.druid.timeline.DataSegment; import org.apache.druid.timeline.DataSegment.PruneSpecsHolder; +import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -58,9 +59,6 @@ public class ImmutableDruidDataSourceTest @Test public void testEqualsMethodThrowsUnsupportedOperationException() { - expectedException.expect(UnsupportedOperationException.class); - expectedException.expectMessage("ImmutableDruidDataSource shouldn't be used as the key in containers"); - final DataSegment segment1 = getTestSegment(); final ImmutableDruidDataSource dataSource1 = getImmutableDruidDataSource(segment1); @@ -69,7 +67,11 @@ public class ImmutableDruidDataSourceTest final ImmutableDruidDataSource dataSource2 = getImmutableDruidDataSource(segment2); - dataSource1.equals(dataSource2); + Assert.assertThrows( + "ImmutableDruidDataSource shouldn't be used as the key in containers", + UnsupportedOperationException.class, + () -> dataSource1.equals(dataSource2) + ); } private ImmutableDruidDataSource getImmutableDruidDataSource(DataSegment segment1) @@ -101,11 +103,13 @@ public class ImmutableDruidDataSourceTest @Test public void testHashCodeMethodThrowsUnsupportedOperationException() { - expectedException.expect(UnsupportedOperationException.class); - expectedException.expectMessage("ImmutableDruidDataSource shouldn't be used as the key in containers"); final DataSegment segment = getTestSegment(); final ImmutableDruidDataSource dataSource = getImmutableDruidDataSource(segment); - dataSource.hashCode(); + Assert.assertThrows( + "ImmutableDruidDataSource shouldn't be used as the key in containers", + UnsupportedOperationException.class, + dataSource::hashCode + ); } } diff --git a/server/src/test/java/org/apache/druid/segment/realtime/FireHydrantTest.java b/server/src/test/java/org/apache/druid/segment/realtime/FireHydrantTest.java index 464141a42a1..0085cb12ead 100644 --- a/server/src/test/java/org/apache/druid/segment/realtime/FireHydrantTest.java +++ b/server/src/test/java/org/apache/druid/segment/realtime/FireHydrantTest.java @@ -212,6 +212,7 @@ public class FireHydrantTest extends InitializedNullHandlingTest } @Test + @SuppressWarnings("ReturnValueIgnored") public void testToStringWhenSwappedWithNull() { hydrant.swapSegment(null);