-
Notifications
You must be signed in to change notification settings - Fork 745
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
Fix errors when suggesting replacements to Lombok generated code #1195
Fix errors when suggesting replacements to Lombok generated code #1195
Conversation
Are you waiting for anything from me on this? Thanks, Rich |
Hi, sorry for not responding to this earlier. I would prefer to avoid handling these errors at this level and discarding the invalid fixes. While this does work around some of the issues with lombok creating AST nodes with invalid source positions, it would also cause Error Prone to silently skip fixes that were incorrect for other reasons, e.g. if there was a bug in a check. There's some related discussion about the underlying problem lombok creates for Error Prone in #1250 (comment), and a link to an upstream lombok bug with they're considering fixing up the source position information for the AST nodes lombok edits, which would help prevent this kind of crash. I'm hopeful that approach will result in a solution that allows lombok and Error Prone to run in the same compilation without crashing Error Prone. |
I am trying to introduce
error-prone
to a large codebase which uses Lombok (see also #1185).I have found that a few rules attempt to suggest fixes to code that Lombok has auto-generated, particularly "setters" and "withers" which use reference equality in a way that upsets some rules.
This auto-generated bytecode does not have valid positions in the sourcecode files, so fix suggestion throws an exception.
This change ignores that exception and skips the fixes in question.