Skip to content

Add rewrite support for tech.picnic.errorprone.refasterrules.FileRulesRecipes #10731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pankraz76
Copy link

@Pankraz76 Pankraz76 commented Aug 10, 2025

Add rewrite support for tech.picnic.errorprone.refasterrules.FileRulesRecipes

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:

Proposal

  1. Add support for errorprone.refasterrules-based rewrites
  2. Implement with opt-in adoption (no breaking changes)
  3. Include suppression mechanisms for API constraints

Discussion Points

  • Need consensus on:
  • Scope of auto-fixes
  • Preferred suppression strategy
  • Integration approach

Next Steps

I’m happy to:

  • Prepare a PoC demonstrating the value
  • Collaborate on implementation strategy
  • Address any concerns about compatibility

relates to:

Hi

Is this any good?

Might consider these changes suggested by error.prone.

Thanks.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Aug 10, 2025

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [7decb4d]

› This message was automatically generated.

@Pankraz76
Copy link
Author

Pankraz76 commented Aug 10, 2025

Is this any good? Kindly request some feedback.

To pitch this, as there is no issue or discussion section for me enabled to post, im providing the issue the PoC in one thread. Please excuse this.

Thanks for considering.

@Pankraz76 Pankraz76 changed the title Add errorprone.refasterrules Add rewrite support for tech.picnic.errorprone.refasterrules.FileRulesRecipes Aug 10, 2025
@Pankraz76
Copy link
Author

BUILD SUCCESSFUL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant