-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed as not planned
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
Add rewrite
support for errorprone.refasterrules
I’d like to propose integrating Google’s Error Prone and its Picnic extension (demonstrated in Automating Away Bugs with Error Prone | PlatformCon 2023) to enable automated bug fixes via rewrite
rules. This would complement Checkstyle’s static analysis capabilities by addressing semantic bugs rather than stylistic issues.
Motivation
Error Prone’s refaster
/rewrite
rules can automatically:
- Fix common bug patterns (e.g.,
String.equals()
misuse) - Modernize code (e.g., JDK migration helpers)
- Enforce best practices (e.g., null-check improvements)
Real-world adoptions show tangible benefits:
- Issue #17487: Introduce
Rewrite
covering S1144: Unused "private" methods should be removed checkstyle/checkstyle#17545 - Fix #5953: [java] PoC: Add
rewrite
support forerrorprone.refasterrules
pmd/pmd#5956 - Introduce
Rewrite & PMD
covering S1144: Unused "private" methods should be removed opensearch-project/OpenSearch#18791 - PoC: Add
rewrite
support forerrorprone.refasterrules
diffplug/spotless#2576 - PoC: Add
rewrite
support forerrorprone.refasterrules
apache/kafka#20219
This might be something to gain feedback on in boot, to start strings up, see the alignment in an ease, following the same direction and convention.
Thanks for considering.
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply