mirror of https://github.com/apache/druid.git
upgrade Error Prone to 2.11 (requires Java 11) (#12306)
The latest version of Error Prone now requires Java 11. Upgrading means we can remove a lot of the maven profile complexity required to run checks with Java 8. This also requires switching our strict build to use Java 11. * update error-prone to 2.11 * remove need for specific maven profiles for Java 8 and Java 15 * fix additional Error Prone warnings with Java 11 * update strict build to use Java 11
This commit is contained in:
parent
b5195c5095
commit
5d02a91faa
|
@ -110,8 +110,10 @@ jobs:
|
|||
# who watches the watchers?
|
||||
script: ./check_test_suite_test.py
|
||||
|
||||
- name: "(openjdk8) strict compilation"
|
||||
- name: "(openjdk11) strict compilation"
|
||||
install: skip
|
||||
# errorprone requires JDK 11
|
||||
jdk: openjdk11
|
||||
# Strict compilation requires more than 2 GB
|
||||
script: >
|
||||
./check_test_suite.py && travis_terminate 0 || MAVEN_OPTS='-Xmx3000m' ${MVN} clean -DstrictCompile compile test-compile --fail-at-end
|
||||
|
|
|
@ -235,6 +235,7 @@ public class JsonConfigurator
|
|||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@SuppressWarnings("ReturnValueIgnored")
|
||||
public static <T> void verifyClazzIsConfigurable(
|
||||
ObjectMapper mapper,
|
||||
Class<T> clazz,
|
||||
|
|
|
@ -74,6 +74,7 @@ public class ThriftInputRowParser implements InputRowParser<Object>
|
|||
this.dimensions = parseSpec.getDimensionsSpec().getDimensionNames();
|
||||
}
|
||||
|
||||
@SuppressWarnings("ReturnValueIgnored")
|
||||
public Class<TBase> getThriftClass()
|
||||
throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException
|
||||
{
|
||||
|
|
|
@ -343,7 +343,7 @@ name: Error Prone Annotations
|
|||
license_category: binary
|
||||
module: java-core
|
||||
license_name: Apache License version 2.0
|
||||
version: 2.8.0
|
||||
version: 2.11.0
|
||||
libraries:
|
||||
- com.google.errorprone: error_prone_annotations
|
||||
|
||||
|
|
74
pom.xml
74
pom.xml
|
@ -88,7 +88,7 @@
|
|||
<datasketches.memory.version>2.0.0</datasketches.memory.version>
|
||||
<derby.version>10.14.2.0</derby.version>
|
||||
<dropwizard.metrics.version>4.0.0</dropwizard.metrics.version>
|
||||
<errorprone.version>2.8.0</errorprone.version>
|
||||
<errorprone.version>2.11.0</errorprone.version>
|
||||
<fastutil.version>8.5.4</fastutil.version>
|
||||
<guava.version>16.0.1</guava.version>
|
||||
<guice.version>4.1.0</guice.version>
|
||||
|
@ -1665,12 +1665,22 @@
|
|||
<fork>true</fork>
|
||||
<meminitial>1024m</meminitial>
|
||||
<maxmem>3000m</maxmem>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
<release>${java.version}</release>
|
||||
<showWarnings>false</showWarnings>
|
||||
<compilerArgs>
|
||||
<arg>-XDcompilePolicy=simple</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>
|
||||
<!-- Error Prone requires exemptions for Java >= 16, see https://errorprone.info/docs/installation#maven -->
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
|
||||
</compilerArgs>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
|
@ -1684,64 +1694,6 @@
|
|||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>strict-java-15+</id>
|
||||
<activation>
|
||||
<jdk>[15,)</jdk>
|
||||
<property>
|
||||
<name>strictCompile</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<release>${java.version}</release>
|
||||
<compilerArgs combine.children="append">
|
||||
<!-- Error Prone requires exemptions for Java 16, see https://errorprone.info/docs/installation#jdk-16 -->
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- using github.com/google/error-prone-javac is required when running on JDK 8
|
||||
see https://errorprone.info/docs/installation#jdk-8 -->
|
||||
<profile>
|
||||
<id>strict-java-8</id>
|
||||
<activation>
|
||||
<jdk>1.8</jdk>
|
||||
<property>
|
||||
<name>strictCompile</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
<compilerArgs combine.children="append">
|
||||
<arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/9+181-r4173-1/javac-9+181-r4173-1.jar</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>parallel-test</id>
|
||||
<activation>
|
||||
|
|
Loading…
Reference in New Issue