Skip to content

Add rewrite support for errorprone.refasterrules #5002

@Pankraz76

Description

@Pankraz76

Add rewrite support for errorprone.refasterrules

I propose integrating Google Error Prone (https://github.com/google/error-prone) with its Picnic extension (demo: https://www.youtube.com/watch?v=6llnrUtVlrE) 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

  1. Support errorprone.refasterrules rewrites
  2. Keep adoption opt-in (no breaking changes)
  3. Provide suppression mechanisms for API constraints

Open Questions

  • Scope of auto-fixes
  • Suppression strategy
  • Integration approach

Next Steps

I can:

  • Prepare a PoC
  • Help with implementation design
  • Address compatibility concerns

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions