Skip to content

SOLR-18296: Upgrade google-java-format to 1.35.0 (JDK 24/25 fix)#4578

Open
serhiy-bzhezytskyy wants to merge 3 commits into
apache:mainfrom
serhiy-bzhezytskyy:gjf-1.35-format-jdk25
Open

SOLR-18296: Upgrade google-java-format to 1.35.0 (JDK 24/25 fix)#4578
serhiy-bzhezytskyy wants to merge 3 commits into
apache:mainfrom
serhiy-bzhezytskyy:gjf-1.35-format-jdk25

Conversation

@serhiy-bzhezytskyy

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-18296

Description

Bumps google-java-format from 1.18.1 to 1.35.0. Java baseline unchanged (JDK 21);
this only affects the spotless code formatter.

google-java-format 1.18.1 calls a javac internal,
Log$DeferredDiagnosticHandler.getDiagnostics(), whose signature changed in
JDK 24, so gradlew tidy / spotlessApply throws NoSuchMethodError on JDK 24+.
1.34.0+ supports the newer JDKs; 1.35.0 is the current release.

This supersedes #4573, restructured per review feedback.

Commits

  1. Upgrade google-java-format to 1.35.0gradle/libs.versions.toml bump +
    changelog entry.
  2. Reformat with google-java-format 1.35.0 — the ~35 files reformatted by
    gradlew tidy under the new version. Pure mechanical formatting, no logic
    changes. Isolated in its own commit and added to .git-blame-ignore-revs.
  3. Add reformat commit to .git-blame-ignore-revs.

The .git-blame-ignore-revs entry references the reformat commit's SHA, so it
relies on that commit being preserved rather than squashed.

On splitting bump vs. reformat into separate PRs

I looked at doing the formatting as a fully separate PR, but for a pure
formatter version bump the two halves can't stand alone — each leaves
spotlessJavaCheck red:

  • bump only (files not yet reformatted): files fail the format check.
  • reformat only (formatter still 1.18.1): spotless crashes on JDK 25 with the
    same NoSuchMethodError this PR fixes.

Only the two together are green. So they're kept in one PR, with the reformat
isolated into its own commit + blame-ignore as suggested.

Testing

gradlew spotlessJavaCheck passes on Eclipse Temurin 21 and JDK 25.

AI assistance disclosure

Per AGENTS.md / how-to-contribute.adoc: prepared with the assistance of an AI
coding agent and reviewed by me for correctness, scope, and alignment with
Solr's build conventions.

google-java-format 1.18.1 calls a javac internal
(Log$DeferredDiagnosticHandler.getDiagnostics()) whose signature changed in
JDK 24, so tidy/spotlessApply throws NoSuchMethodError on JDK 24+. 1.34.0+
supports the newer JDKs; this bumps to 1.35.0. Java baseline unchanged (21).
Pure mechanical reformatting from ./gradlew tidy with the upgraded formatter.
No logic changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant