Upgrade to Java 25 (#3000)

Error-prone introduced many more checks in Java 25. We fixed a few
and suppressed most. A follow-up bug is opened to clean this up.
An ai agent should be able to clean up most of it.

This PR is created with gemini-cli. Summary of experience:

* The good: AI caught most compatibility issues, and with permission,
  suppressed them through compiler flags and errorprone options.
  It also caught many versio references in scripts.

* Where it didn't shine:
  - It did not find and update the target version spec in the custome
    VKey annotation processor source file.
  - It did not flag eclipse-temurin:21 docker image for upgrade.
  - When running into failure, its first instinct is to disable checks
    e.g., -Werror instead of fixing them.
This commit is contained in:
Weimin Yu
2026-04-02 21:23:00 +00:00
committed by GitHub
parent 9f3dfec118
commit d2881b47dc
25 changed files with 253 additions and 258 deletions
+14 -18
View File
@@ -1,7 +1,6 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
aopalliance:aopalliance:1.0=annotationProcessor,testAnnotationProcessor
com.fasterxml.jackson.core:jackson-annotations:2.10.3=testCompileClasspath,testRuntimeClasspath
com.github.ben-manes.caffeine:caffeine:3.0.5=annotationProcessor,testAnnotationProcessor
com.github.ben-manes.caffeine:caffeine:3.2.3=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -27,7 +26,7 @@ com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,testA
com.google.auto.value:auto-value-annotations:1.11.0=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.auto.value:auto-value-annotations:1.9=annotationProcessor,testAnnotationProcessor
com.google.auto.value:auto-value:1.11.1=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor
com.google.auto:auto-common:1.2.2=annotationProcessor,testAnnotationProcessor
com.google.cloud:google-cloud-tasks:2.51.0=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,checkstyle,deploy_jar,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.code.gson:gson:2.12.1=deploy_jar,runtimeClasspath,testRuntimeClasspath
@@ -35,33 +34,30 @@ com.google.dagger:dagger-compiler:2.59.2=annotationProcessor,testAnnotationProce
com.google.dagger:dagger-spi:2.59.2=annotationProcessor,testAnnotationProcessor
com.google.dagger:dagger:2.59.2=annotationProcessor,compileClasspath,deploy_jar,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.devtools.ksp:symbol-processing-api:2.2.20-2.0.3=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_annotation:2.23.0=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_annotations:2.23.0=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_annotation:2.48.0=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_annotations:2.36.0=checkstyle
com.google.errorprone:error_prone_annotations:2.41.0=compileClasspath
com.google.errorprone:error_prone_annotations:2.43.0=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.errorprone:error_prone_check_api:2.23.0=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_core:2.23.0=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_type_annotations:2.23.0=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_annotations:2.48.0=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_check_api:2.48.0=annotationProcessor,testAnnotationProcessor
com.google.errorprone:error_prone_core:2.48.0=annotationProcessor,testAnnotationProcessor
com.google.flogger:flogger-system-backend:0.9=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.flogger:flogger:0.9=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.google.googlejavaformat:google-java-format:1.33.0=annotationProcessor,testAnnotationProcessor
com.google.guava:failureaccess:1.0.2=annotationProcessor,testAnnotationProcessor,testCompileClasspath
com.google.guava:failureaccess:1.0.3=checkstyle,compileClasspath,deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.guava:guava:33.0.0-jre=annotationProcessor,testAnnotationProcessor
com.google.googlejavaformat:google-java-format:1.34.1=annotationProcessor,testAnnotationProcessor
com.google.guava:failureaccess:1.0.2=testCompileClasspath
com.google.guava:failureaccess:1.0.3=annotationProcessor,checkstyle,compileClasspath,deploy_jar,runtimeClasspath,testAnnotationProcessor,testRuntimeClasspath
com.google.guava:guava:33.4.3-android=testCompileClasspath
com.google.guava:guava:33.4.8-jre=checkstyle
com.google.guava:guava:33.5.0-jre=compileClasspath,deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.guava:guava:33.5.0-jre=annotationProcessor,compileClasspath,deploy_jar,runtimeClasspath,testAnnotationProcessor,testRuntimeClasspath
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,checkstyle,compileClasspath,deploy_jar,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.http-client:google-http-client-apache-v2:1.45.2=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.http-client:google-http-client-gson:2.1.0=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.http-client:google-http-client:2.1.0=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.inject:guice:5.1.0=annotationProcessor,testAnnotationProcessor
com.google.j2objc:j2objc-annotations:3.0.0=checkstyle,testCompileClasspath
com.google.j2objc:j2objc-annotations:3.1=compileClasspath,deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.j2objc:j2objc-annotations:3.1=annotationProcessor,compileClasspath,deploy_jar,runtimeClasspath,testAnnotationProcessor,testRuntimeClasspath
com.google.oauth-client:google-oauth-client:1.36.0=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.protobuf:protobuf-java-util:4.34.1=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.protobuf:protobuf-java:3.19.6=annotationProcessor,testAnnotationProcessor
com.google.protobuf:protobuf-java:4.33.2=annotationProcessor,testAnnotationProcessor
com.google.protobuf:protobuf-java:4.34.1=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.re2j:re2j:1.7=deploy_jar,runtimeClasspath,testRuntimeClasspath
com.google.truth:truth:1.4.5=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -75,7 +71,7 @@ commons-codec:commons-codec:1.17.1=deploy_jar,runtimeClasspath,testRuntimeClassp
commons-collections:commons-collections:3.2.2=checkstyle
commons-logging:commons-logging:1.2=deploy_jar,runtimeClasspath,testRuntimeClasspath
info.picocli:picocli:4.7.7=checkstyle
io.github.eisop:dataflow-errorprone:3.34.0-eisop1=annotationProcessor,testAnnotationProcessor
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,testAnnotationProcessor
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,testAnnotationProcessor
io.github.java-diff-utils:java-diff-utils:4.16=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.grpc:grpc-alts:1.68.0=deploy_jar,runtimeClasspath,testRuntimeClasspath
@@ -139,7 +135,7 @@ org.bouncycastle:bcprov-jdk18on:1.83=compileClasspath,deploy_jar,runtimeClasspat
org.bouncycastle:bcutil-jdk18on:1.83=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.checkerframework:checker-compat-qual:2.5.3=annotationProcessor,testAnnotationProcessor
org.checkerframework:checker-compat-qual:2.5.6=deploy_jar,runtimeClasspath,testRuntimeClasspath
org.checkerframework:checker-qual:3.41.0=annotationProcessor,testAnnotationProcessor
org.checkerframework:checker-qual:3.19.0=annotationProcessor,testAnnotationProcessor
org.checkerframework:checker-qual:3.43.0=testCompileClasspath
org.checkerframework:checker-qual:3.47.0=deploy_jar,runtimeClasspath,testRuntimeClasspath
org.checkerframework:checker-qual:3.49.3=checkstyle
@@ -180,7 +176,7 @@ org.ow2.asm:asm-commons:9.9=jacocoAnt
org.ow2.asm:asm-tree:9.9=jacocoAnt
org.ow2.asm:asm:9.8=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.ow2.asm:asm:9.9=jacocoAnt
org.pcollections:pcollections:3.1.4=annotationProcessor,testAnnotationProcessor
org.pcollections:pcollections:4.0.1=annotationProcessor,testAnnotationProcessor
org.reflections:reflections:0.10.2=checkstyle
org.rnorth.duct-tape:duct-tape:1.0.8=testCompileClasspath,testRuntimeClasspath
org.slf4j:slf4j-api:1.7.36=testCompileClasspath,testRuntimeClasspath
@@ -276,7 +276,7 @@ public final class CertificateSupplierModule {
static Supplier<PrivateKey> providePemPrivateKeySupplier(
@PemFile Provider<PrivateKey> privateKeyProvider,
@Named("remoteCertCachingDuration") Duration cachingDuration) {
return memoizeWithExpiration(privateKeyProvider::get, cachingDuration.getSeconds(), SECONDS);
return memoizeWithExpiration(privateKeyProvider::get, cachingDuration.toSeconds(), SECONDS);
}
@Singleton
@@ -285,7 +285,7 @@ public final class CertificateSupplierModule {
static Supplier<ImmutableList<X509Certificate>> providePemCertificatesSupplier(
@PemFile Provider<ImmutableList<X509Certificate>> certificatesProvider,
@Named("remoteCertCachingDuration") Duration cachingDuration) {
return memoizeWithExpiration(certificatesProvider::get, cachingDuration.getSeconds(), SECONDS);
return memoizeWithExpiration(certificatesProvider::get, cachingDuration.toSeconds(), SECONDS);
}
// TODO(jianglai): Implement P12 supplier or convert the file to PEM format.