Skip to content

build: enable error-prone's FormatString check#14916

Merged
rmuir merged 1 commit intoapache:mainfrom
rmuir:error_prone_format_string
Jul 8, 2025
Merged

build: enable error-prone's FormatString check#14916
rmuir merged 1 commit intoapache:mainfrom
rmuir:error_prone_format_string

Conversation

@rmuir
Copy link
Member

@rmuir rmuir commented Jul 7, 2025

This check will find some printf-style format problems at compile-time instead of runtime: enable it.

Please note: this won't find my original bug yet on #14901, maybe because the file is in src/java24. But I tested it works by adding an extra %s to a format string in IndexWriter.java and it properly fails the build. I will dig on the src/java24 issue separately... I suspect we're not running error-prone on these sources.

We have hundreds of such format strings in the codebase, many of which might not have perfect test coverage (they are printing), so it is a good check to have.

This check will find some printf-style format problems at compile-time
instead of runtime: enable it.
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2025

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.

@rmuir rmuir merged commit ea76d81 into apache:main Jul 8, 2025
8 checks passed
@uschindler
Copy link
Contributor

I think we can backport this.

@rmuir
Copy link
Member Author

rmuir commented Jul 8, 2025

@uschindler It is a good idea. I will take care of it shortly.

@rmuir
Copy link
Member Author

rmuir commented Jul 8, 2025

Sorry: I came back to this and its conflict-central because build sources are moved around. I'm gonna stay focused on improving main, but of course don't mind if anyone wants to backport PRs of interest.

@dweiss
Copy link
Contributor

dweiss commented Jul 9, 2025

The build on main is far from branch_10x. I've been wondering if backporting everything is a good idea and when to do it (now, later). I have a feeling that - until main reaches some kind of maturity - backporting will involve a lot of extra work. Maybe we should hold off and do it as a one-step later, don't know.

@rmuir
Copy link
Member Author

rmuir commented Jul 9, 2025

it is also ok to make new major releases when there is lots of change like this :)

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.

3 participants