{{ message }}
Bump google-java-format to 1.27.0 and fmt CI JDK to 17#778
Open
Divyansh-db wants to merge 1 commit intomainfrom
Open
Bump google-java-format to 1.27.0 and fmt CI JDK to 17#778Divyansh-db wants to merge 1 commit intomainfrom
Divyansh-db wants to merge 1 commit intomainfrom
Conversation
Follow-up to #777. Pinning GJF to 1.22.0 did not fix the JDK 25 generator crash because 1.22.0 still calls the old Queue-returning Log$DeferredDiagnosticHandler.getDiagnostics() signature that JDK 23+ removed. GJF 1.27.0 is the first release with the DeferredDiagnosticHandler compatibility fix, but it requires JRE 17+ to run. Bump the fmt CI job's java-version from 11 to 17 to match. The unit-tests matrix (JDK 8/11/17/20), release-build-check (JDK 8) and check-lock (JDK 11) are unaffected - none invoke spotless. Compiled bytecode target remains Java 8. Verified locally: - JDK 17: spotless:check passes - JDK 11: UnsupportedClassVersionError (intentional floor, class file v61.0) - JDK 25: scripts/mvn-spotless-apply.sh returns BUILD SUCCESS Co-authored-by: Isaac
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Follow-up to #777. That PR pinned google-java-format to 1.22.0 under the assumption it had the JDK 25 compatibility fix — it doesn't. GJF 1.22.0 still calls the old
Queue-returningLog$DeferredDiagnosticHandler.getDiagnostics()signature that OpenJDK removed in JDK 23+, so the code generator (JDK 25) continued crashing with the sameNoSuchMethodError.pom.xml) — first release with theDeferredDiagnosticHandlerAPI-change fix (Google's commit96f114c, shipped 2025-05-06)..github/workflows/push.yml) — GJF 1.25.0+ requires JRE 17 to run, so any version that supports JDK 25 requires bumping the fmt JVM floor. No GJF version supports both JRE 11 and JDK 25.Scope of the JDK bump
Only the
fmtjob (runsmvn spotless:check) moves. The rest of CI is unchanged:unit-testsmatrix (JDK 8/11/17/20 runningmvn test): unaffected. Spotless has no<execution>binding, somvn testnever loads GJF.release-build-check.yml/package.yml(JDK 8): unaffected, same reason.check-lockjob (JDK 11): unaffected.maven-compiler-plugin.Impact on local dev
Running
mvn spotless:apply/:checklocally now requires JDK 17+. Everything else (builds, tests, releases) still works on JDK 8/11. Switching JDKs per-command:JAVA_HOME=/path/to/jdk17 mvn spotless:apply.Why not keep spotless simple by downgrading the generator?
Because there's no GJF version that runs on both JRE 11 and JDK 25 — GJF raised its minimum to JRE 17 in 1.25.0, and JDK 25 compatibility only landed in 1.27.0. The constraint box has no solution other than raising the JVM floor for the one CI job that actually invokes spotless.
Test plan
Verified locally against all three JDKs available on the dev machine:
JAVA_HOME=.../java-17-openjdk-amd64 mvn spotless:check→BUILD SUCCESS(14s)UnsupportedClassVersionError: ... class file version 61.0, this version of the Java Runtime only recognizes class file versions up to 55.0. Intentional floor, not a regression; JDK 11 CI jobs don't invoke spotless so this is only seen by local devs who try to format under JDK 11.JAVA_HOME=.../temurin-25-jdk-amd64 bash scripts/mvn-spotless-apply.sh→BUILD SUCCESS(13s). This is the end-to-end reproduction of the generator's environment, which was missing from Fix spotless:apply failure on modern JDKs #777's testing.git diff --statshows no source-file reformats needed by GJF 1.27.0 — diff is just the two config edits. 1.22.0 → 1.27.0 rule changes happened to not hit anything in this codebase.fmt(now JDK 17), allunit-testsmatrix rows,release-build-check,check-lockall green.NO_CHANGELOG=true