Bump google-java-format to 1.27.0 and fmt CI JDK to 17 by Divyansh-db · Pull Request #778 · databricks/databricks-sdk-java · GitHub
Skip to content

Bump google-java-format to 1.27.0 and fmt CI JDK to 17#778

Open
Divyansh-db wants to merge 1 commit intomainfrom
fix-formatter-jdk25
Open

Bump google-java-format to 1.27.0 and fmt CI JDK to 17#778
Divyansh-db wants to merge 1 commit intomainfrom
fix-formatter-jdk25

Conversation

@Divyansh-db
Copy link
Copy Markdown
Contributor

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-returning Log$DeferredDiagnosticHandler.getDiagnostics() signature that OpenJDK removed in JDK 23+, so the code generator (JDK 25) continued crashing with the same NoSuchMethodError.

  • Bump GJF to 1.27.0 (pom.xml) — first release with the DeferredDiagnosticHandler API-change fix (Google's commit 96f114c, shipped 2025-05-06).
  • Bump fmt CI job to JDK 17 (.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 fmt job (runs mvn spotless:check) moves. The rest of CI is unchanged:

  • unit-tests matrix (JDK 8/11/17/20 running mvn test): unaffected. Spotless has no <execution> binding, so mvn test never loads GJF.
  • release-build-check.yml / package.yml (JDK 8): unaffected, same reason.
  • check-lock job (JDK 11): unaffected.
  • Compiled bytecode target stays Java 8 via maven-compiler-plugin.

Impact on local dev

Running mvn spotless:apply / :check locally 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:

  • JDK 17JAVA_HOME=.../java-17-openjdk-amd64 mvn spotless:checkBUILD SUCCESS (14s)
  • JDK 11 — fails with 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.
  • JDK 25JAVA_HOME=.../temurin-25-jdk-amd64 bash scripts/mvn-spotless-apply.shBUILD 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 --stat shows 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.
  • CI: fmt (now JDK 17), all unit-tests matrix rows, release-build-check, check-lock all green.

NO_CHANGELOG=true

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
@github-actions
Copy link
Copy Markdown
Contributor

@Divyansh-db Divyansh-db deployed to test-trigger-is April 24, 2026 12:30 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant