-
Notifications
You must be signed in to change notification settings - Fork 485
Closed
Labels
Description
Add rewrite
support for errorprone.refasterrules
I propose integrating Google Error Prone with its Picnic extension (see Automating Away Bugs with Error Prone | PlatformCon 2023) to enable automated fixes via rewrite
rules.
This would complement Checkstyle by addressing semantic bugs rather than just stylistic issues.
Motivation
Error Prone’s refaster
/rewrite
rules can:
- Fix common bug patterns (e.g.,
String.equals()
misuse) - Modernize code (e.g., JDK migration helpers)
- Enforce best practices (e.g., null-checks)
Adoption examples:
Proposal
- Add support for
errorprone.refasterrules
rewrites - Make adoption opt-in (no breaking changes)
- Provide suppression mechanisms for API constraints
Open Questions
- Scope of auto-fixes
- Preferred suppression strategy
- Integration approach
Next Steps
I can:
- Prepare a PoC
- Help design the implementation
- Address compatibility concerns
Most earlier objections have been resolved; from a technical perspective, there’s little reason not to automate this now—unless new concerns arise.