build: enable error-prone's FormatString check#14916
Conversation
This check will find some printf-style format problems at compile-time instead of runtime: enable it.
|
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. |
|
I think we can backport this. |
|
@uschindler It is a good idea. I will take care of it shortly. |
|
Sorry: I came back to this and its conflict-central because build sources are moved around. I'm gonna stay focused on improving |
|
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. |
|
it is also ok to make new major releases when there is lots of change like this :) |
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%sto a format string in IndexWriter.java and it properly fails the build. I will dig on thesrc/java24issue 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.