mirror of https://github.com/apache/druid.git
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
This commit is contained in:
parent
9b250c54aa
commit
4bca7f014e
|
@ -56,6 +56,6 @@ public class NoneShardSpecTest
|
||||||
final String jsonStr = "{\"type\": \"none\",\"partitionNum\": 2}";
|
final String jsonStr = "{\"type\": \"none\",\"partitionNum\": 2}";
|
||||||
ObjectMapper mapper = new TestObjectMapper();
|
ObjectMapper mapper = new TestObjectMapper();
|
||||||
final ShardSpec noneShardSpec = mapper.readValue(jsonStr, ShardSpec.class);
|
final ShardSpec noneShardSpec = mapper.readValue(jsonStr, ShardSpec.class);
|
||||||
noneShardSpec.equals(NoneShardSpec.instance());
|
Assert.assertEquals(NoneShardSpec.instance(), noneShardSpec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,24 +183,4 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</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>
|
</project>
|
||||||
|
|
|
@ -324,24 +324,4 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</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>
|
</project>
|
||||||
|
|
|
@ -39,6 +39,7 @@ public class RetryIfUnauthorizedResponseHandler<Intermediate, Final>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("ReturnValueIgnored")
|
||||||
public ClientResponse<RetryResponseHolder<Intermediate>> handleResponse(
|
public ClientResponse<RetryResponseHolder<Intermediate>> handleResponse(
|
||||||
HttpResponse httpResponse,
|
HttpResponse httpResponse,
|
||||||
TrafficCop trafficCop
|
TrafficCop trafficCop
|
||||||
|
@ -55,6 +56,7 @@ public class RetryIfUnauthorizedResponseHandler<Intermediate, Final>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("ReturnValueIgnored")
|
||||||
public ClientResponse<RetryResponseHolder<Intermediate>> handleChunk(
|
public ClientResponse<RetryResponseHolder<Intermediate>> handleChunk(
|
||||||
ClientResponse<RetryResponseHolder<Intermediate>> clientResponse,
|
ClientResponse<RetryResponseHolder<Intermediate>> clientResponse,
|
||||||
HttpChunk httpChunk,
|
HttpChunk httpChunk,
|
||||||
|
|
|
@ -198,23 +198,4 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</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>
|
</project>
|
||||||
|
|
|
@ -350,7 +350,7 @@ name: Error Prone Annotations
|
||||||
license_category: binary
|
license_category: binary
|
||||||
module: java-core
|
module: java-core
|
||||||
license_name: Apache License version 2.0
|
license_name: Apache License version 2.0
|
||||||
version: 2.7.1
|
version: 2.8.0
|
||||||
libraries:
|
libraries:
|
||||||
- com.google.errorprone: error_prone_annotations
|
- com.google.errorprone: error_prone_annotations
|
||||||
|
|
||||||
|
|
5
pom.xml
5
pom.xml
|
@ -87,7 +87,7 @@
|
||||||
<datasketches.memory.version>1.3.0</datasketches.memory.version>
|
<datasketches.memory.version>1.3.0</datasketches.memory.version>
|
||||||
<derby.version>10.14.2.0</derby.version>
|
<derby.version>10.14.2.0</derby.version>
|
||||||
<dropwizard.metrics.version>4.0.0</dropwizard.metrics.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>
|
<fastutil.version>8.5.4</fastutil.version>
|
||||||
<guava.version>16.0.1</guava.version>
|
<guava.version>16.0.1</guava.version>
|
||||||
<guice.version>4.1.0</guice.version>
|
<guice.version>4.1.0</guice.version>
|
||||||
|
@ -1694,8 +1694,7 @@
|
||||||
<showWarnings>false</showWarnings>
|
<showWarnings>false</showWarnings>
|
||||||
<compilerArgs>
|
<compilerArgs>
|
||||||
<arg>-XDcompilePolicy=simple</arg>
|
<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</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 -Xep:LongFloatConversion:OFF</arg>
|
|
||||||
</compilerArgs>
|
</compilerArgs>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
|
|
|
@ -361,7 +361,7 @@ public class IndexIOTest extends InitializedNullHandlingTest
|
||||||
queryableIndex.getDimensionHandlers();
|
queryableIndex.getDimensionHandlers();
|
||||||
List<String> columnNames = queryableIndex.getColumnNames();
|
List<String> columnNames = queryableIndex.getColumnNames();
|
||||||
for (String columnName : columnNames) {
|
for (String columnName : columnNames) {
|
||||||
queryableIndex.getColumnHolder(columnName).toString();
|
Assert.assertNotNull(queryableIndex.getColumnHolder(columnName).toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.druid.java.util.common.Intervals;
|
||||||
import org.apache.druid.test.utils.ImmutableDruidDataSourceTestUtils;
|
import org.apache.druid.test.utils.ImmutableDruidDataSourceTestUtils;
|
||||||
import org.apache.druid.timeline.DataSegment;
|
import org.apache.druid.timeline.DataSegment;
|
||||||
import org.apache.druid.timeline.DataSegment.PruneSpecsHolder;
|
import org.apache.druid.timeline.DataSegment.PruneSpecsHolder;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
import org.junit.rules.ExpectedException;
|
||||||
|
@ -58,9 +59,6 @@ public class ImmutableDruidDataSourceTest
|
||||||
@Test
|
@Test
|
||||||
public void testEqualsMethodThrowsUnsupportedOperationException()
|
public void testEqualsMethodThrowsUnsupportedOperationException()
|
||||||
{
|
{
|
||||||
expectedException.expect(UnsupportedOperationException.class);
|
|
||||||
expectedException.expectMessage("ImmutableDruidDataSource shouldn't be used as the key in containers");
|
|
||||||
|
|
||||||
final DataSegment segment1 = getTestSegment();
|
final DataSegment segment1 = getTestSegment();
|
||||||
|
|
||||||
final ImmutableDruidDataSource dataSource1 = getImmutableDruidDataSource(segment1);
|
final ImmutableDruidDataSource dataSource1 = getImmutableDruidDataSource(segment1);
|
||||||
|
@ -69,7 +67,11 @@ public class ImmutableDruidDataSourceTest
|
||||||
|
|
||||||
final ImmutableDruidDataSource dataSource2 = getImmutableDruidDataSource(segment2);
|
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)
|
private ImmutableDruidDataSource getImmutableDruidDataSource(DataSegment segment1)
|
||||||
|
@ -101,11 +103,13 @@ public class ImmutableDruidDataSourceTest
|
||||||
@Test
|
@Test
|
||||||
public void testHashCodeMethodThrowsUnsupportedOperationException()
|
public void testHashCodeMethodThrowsUnsupportedOperationException()
|
||||||
{
|
{
|
||||||
expectedException.expect(UnsupportedOperationException.class);
|
|
||||||
expectedException.expectMessage("ImmutableDruidDataSource shouldn't be used as the key in containers");
|
|
||||||
final DataSegment segment = getTestSegment();
|
final DataSegment segment = getTestSegment();
|
||||||
final ImmutableDruidDataSource dataSource = getImmutableDruidDataSource(segment);
|
final ImmutableDruidDataSource dataSource = getImmutableDruidDataSource(segment);
|
||||||
|
|
||||||
dataSource.hashCode();
|
Assert.assertThrows(
|
||||||
|
"ImmutableDruidDataSource shouldn't be used as the key in containers",
|
||||||
|
UnsupportedOperationException.class,
|
||||||
|
dataSource::hashCode
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,6 +212,7 @@ public class FireHydrantTest extends InitializedNullHandlingTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("ReturnValueIgnored")
|
||||||
public void testToStringWhenSwappedWithNull()
|
public void testToStringWhenSwappedWithNull()
|
||||||
{
|
{
|
||||||
hydrant.swapSegment(null);
|
hydrant.swapSegment(null);
|
||||||
|
|
Loading…
Reference in New Issue