update error-prone to 2.8.0 with fix for crashing check (#11494)
* error-prone 2.8.0 fixes https://github.com/google/error-prone/issues/2396
* fix for a few ignored return values
* fix unknown args in sub-modules
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 04a519d..a277773 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 @@
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 07b8edb..c68b7f4 100644
--- a/extensions-contrib/thrift-extensions/pom.xml
+++ b/extensions-contrib/thrift-extensions/pom.xml
@@ -183,24 +183,4 @@
</plugin>
</plugins>
</build>
-
- <profiles>
- <profile>
- <id>strict</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgs>
- <!-- Thrift-generated classes miss @Override, that is not easy to fix -->
- <arg>-Xep:MissingOverride:WARN</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git a/extensions-core/avro-extensions/pom.xml b/extensions-core/avro-extensions/pom.xml
index adb64bf..c1f1af6 100644
--- a/extensions-core/avro-extensions/pom.xml
+++ b/extensions-core/avro-extensions/pom.xml
@@ -324,24 +324,4 @@
</plugin>
</plugins>
</build>
-
- <profiles>
- <profile>
- <id>strict</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgs>
- <!-- Avro-generated classes miss @Override, that is not easy to fix -->
- <arg>-Xep:MissingOverride:WARN</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
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 9f3b732..c71fa71 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 @@
}
@Override
+ @SuppressWarnings("ReturnValueIgnored")
public ClientResponse<RetryResponseHolder<Intermediate>> handleResponse(
HttpResponse httpResponse,
TrafficCop trafficCop
@@ -55,6 +56,7 @@
}
@Override
+ @SuppressWarnings("ReturnValueIgnored")
public ClientResponse<RetryResponseHolder<Intermediate>> handleChunk(
ClientResponse<RetryResponseHolder<Intermediate>> clientResponse,
HttpChunk httpChunk,
diff --git a/extensions-core/protobuf-extensions/pom.xml b/extensions-core/protobuf-extensions/pom.xml
index 5c2ac8f..87c3ec4 100644
--- a/extensions-core/protobuf-extensions/pom.xml
+++ b/extensions-core/protobuf-extensions/pom.xml
@@ -198,23 +198,4 @@
</plugin>
</plugins>
</build>
- <profiles>
- <profile>
- <id>strict</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgs>
- <!-- protobuf compiler generated classes miss @Override, that is not easy to fix -->
- <arg>-Xep:MissingOverride:WARN</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git a/licenses.yaml b/licenses.yaml
index 88f6bf2..dee7ac3 100644
--- a/licenses.yaml
+++ b/licenses.yaml
@@ -350,7 +350,7 @@
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 6313a87..1bef256 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,7 @@
<datasketches.memory.version>1.3.0</datasketches.memory.version>
<derby.version>10.14.2.0</derby.version>
<dropwizard.metrics.version>4.0.0</dropwizard.metrics.version>
- <errorprone.version>2.7.1</errorprone.version>
+ <errorprone.version>2.8.0</errorprone.version>
<fastutil.version>8.5.4</fastutil.version>
<guava.version>16.0.1</guava.version>
<guice.version>4.1.0</guice.version>
@@ -1694,8 +1694,7 @@
<showWarnings>false</showWarnings>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
- <!-- disable LongFloatConversion until https://github.com/google/error-prone/issues/2396 is fixed -->
- <arg>-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</arg>
+ <arg>-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</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
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 b6a9155..1911aa6 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 @@
queryableIndex.getDimensionHandlers();
List<String> 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 bf8e454..36bf4e6 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.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 @@
@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 @@
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 @@
@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 464141a..0085cb1 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 @@
}
@Test
+ @SuppressWarnings("ReturnValueIgnored")
public void testToStringWhenSwappedWithNull()
{
hydrant.swapSegment(null);