From 4e08591bf6f1bc0c08e720d5508b026f7f618ac3 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Thu, 27 Oct 2022 11:05:11 -0700 Subject: [PATCH] Update Error Prone. This has some effects on us as we develop Guava, but it doesn't affect end users. Specifically: - When we build Guava with JDK8, we now have to disable Error Prone. (Again, users can still use Guava with JDK8, including with Error Prone. The effect is limited to people who are developing Guava.) - We can now successfully build Guava with Error Prone under more recent JDKs. That is, this change should fix the error reported in https://github.com/google/guava/issues/6217#issuecomment-1287990845. (I'm not sure if the Error Prone update was necessary for that or if only the other `pom.xml` changes were. Still, it seems inevitable that we'll be forced to upgrade Error Prone eventually, and it's rarely a bad idea to update a plugin.) This change is progress toward building and testing under Java 17 (https://github.com/google/guava/issues/5801)... ...which we apparently regressed at when we enabled Error Prone (https://github.com/google/guava/issues/2484). Oddly, it seems that part of our existing Error Prone setup is _required_ to continue building Guava under JDK8. (Such builds are potentially useful for https://github.com/google/guava/issues/3990 or for anyone building Guava manually with an old JDK.) That's the case even though we're now disabling Error Prone for those builds. Again, all these changes affect only people who are developing Guava, not end users. RELNOTES=n/a PiperOrigin-RevId: 484299394 --- android/pom.xml | 79 +++++++++++++++++++++++++++++++++++++++++++++---- pom.xml | 79 +++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 146 insertions(+), 12 deletions(-) diff --git a/android/pom.xml b/android/pom.xml index c4c5d7baa2f8..bdeb5c35fa58 100644 --- a/android/pom.xml +++ b/android/pom.xml @@ -135,16 +135,22 @@ doesnotexist -XDcompilePolicy=simple - -Xplugin:ErrorProne + com.google.errorprone error_prone_core - - 2.10.0 + 2.16 + + true @@ -439,9 +445,8 @@ - - jdk8 + javac9-for-jdk8 1.8 @@ -451,7 +456,26 @@ org.apache.maven.plugins maven-compiler-plugin - true + -J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar @@ -460,5 +484,48 @@ + + new-enough-for-error-prone + + [9,) + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + + -Xplugin:ErrorProne -Xep:NullArgumentForNonNullParameter:OFF + + + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + + + diff --git a/pom.xml b/pom.xml index 826f05864dd2..ab84d3f8cd39 100644 --- a/pom.xml +++ b/pom.xml @@ -136,16 +136,22 @@ doesnotexist -XDcompilePolicy=simple - -Xplugin:ErrorProne + com.google.errorprone error_prone_core - - 2.10.0 + 2.16 + + true @@ -446,9 +452,8 @@ - - jdk8 + javac9-for-jdk8 1.8 @@ -458,7 +463,26 @@ org.apache.maven.plugins maven-compiler-plugin - true + -J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar @@ -467,5 +491,48 @@ + + new-enough-for-error-prone + + [9,) + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + + -Xplugin:ErrorProne -Xep:NullArgumentForNonNullParameter:OFF + + + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + + +