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.
Add
rewritesupport forerrorprone.refasterrulesI propose integrating Google Error Prone with its Picnic extension (see Automating Away Bugs with Error Prone | PlatformCon 2023) to enable automated fixes via
rewriterules.This would complement Checkstyle by addressing semantic bugs rather than just stylistic issues.
Motivation
Error Prone’s
refaster/rewriterules can:String.equals()misuse)Adoption examples:
Proposal
errorprone.refasterrulesrewritesOpen Questions
Next Steps
I can:
Most earlier objections have been resolved; from a technical perspective, there’s little reason not to automate this now—unless new concerns arise.