Skip to content

SOLR-18296: Upgrade google-java-format to 1.35.0#4573

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

SOLR-18296: Upgrade google-java-format to 1.35.0#4573
serhiy-bzhezytskyy wants to merge 3 commits into
apache:mainfrom
serhiy-bzhezytskyy:gjf-1.35-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. The Java baseline is 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+ adds support for newer JDKs; 1.35.0 is the current release.

Changes

  • gradle/libs.versions.toml: google-javaformat 1.18.1 -> 1.35.0
  • re-ran gradlew tidy: ~35 files reformatted (minor, mechanical — the new formatter version's rules), no logic changes
  • spotless (8.3.0) drives the new version with no other change
  • changelog entry added under changelog/unreleased/

Testing

gradlew spotlessJavaCheck passes on Eclipse Temurin 21 and on JDK 25.

Notes for reviewers

  • Discussed on dev@ before opening (thread: "Upgrading google-java-format (spotless) — fixes JDK 24/25 build break"); no objection (thanks David).

AI assistance disclosure

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

@janhoy janhoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR should be split in two commits. One for the toml file and changelog, and another for the 35 reformatted files.

Then add the commit sha for the reformat to .git-blame-ignore-revs. This PR will then be manually pushed, not squashed.

@dsmiley

dsmiley commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

I agree with Janhoy. Note that you need not manipulate this PR to "split" it; you can simply put this on hold temporarily and create another PR for the formatting matter. Once that formatting PR merges, then get this PR up to date from main, and add the commit sha janhoy mentions.

serhiy-bzhezytskyy and others added 3 commits July 1, 2026 06:17
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).

The mechanical reformatting produced by the new formatter is in a separate
follow-up commit so it can be added to .git-blame-ignore-revs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pure mechanical reformatting from running ./gradlew tidy with the upgraded
formatter. No logic changes. This commit's SHA is added to
.git-blame-ignore-revs (in a follow-up) so git blame skips it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@serhiy-bzhezytskyy

Copy link
Copy Markdown
Contributor Author

Thanks @janhoy and @dsmiley. I've restructured this into a fresh PR: #4578

  • commit 1: the 1.35.0 bump + changelog
  • commit 2: the ~35 reformatted files (isolated), added to .git-blame-ignore-revs
  • commit 3: the blame-ignore entry

One note on the two-PR suggestion: for a pure formatter version bump the bump
and the reformat can't be separated — each fails spotlessJavaCheck alone (bump
alone → unformatted files; reformat alone → gjf 1.18.1 crashes on JDK 25, which
is the bug this fixes). So I kept them in one PR with the reformat isolated in
its own commit per Jan's suggestion, which preserves the blame-ignore SHA.

Closing this in favour of #4578.

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.

3 participants