You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enabling Lombok's @Generated annotation via lombok.addLombokGeneratedAnnotation = true does not reduce the number of reported issues.
Feature requests: what underlying problem are you trying to solve with this feature?
Error Prone ignores the lombok.Generated annotation. Unlike the javax.annotation.processing.Generated annotation this one has @Retention(CLASS) instead of SOURCE.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Adding a few Lombok annotations is usually enough to trigger a violation. There are already some examples available here: #1700 #1482 #1481
What version of Error Prone are you using?
2.4.0
Have you found anything relevant by searching the web?
It would actually be great if ErrorProne accepted any annotation named Generated whichever the package.
The fact that javax.annotation.processing.Generated has SOURCE retention is a real problem, leading to many code generators to come with their own Generated annotation with CLASS retention (like the now-defunct javax.annotation.Generated): Lombok, Immutables, someone asked it for jOOQ, someone else for MapStruct, and I'm sure there are (many) others.
Reacted by Roel Spilker, Reinier Zwitserloot, Lari Hotari and Manu Sridharan
#1984 is a related bug about org.immutables (which I think is supposed to try to use the javax.* annotations if they're available, but doesn't seem to be doing that).
That doesn't solve all of our problems with lombok (see #1250 (comment) for current thoughts on that), but it should be enough to recognize lombok's annotation in -XepDisableWarningsInGeneratedCode
Activity
tbroyer commentedon Oct 16, 2020
It would actually be great if ErrorProne accepted any annotation named
Generatedwhichever the package.The fact that
javax.annotation.processing.GeneratedhasSOURCEretention is a real problem, leading to many code generators to come with their ownGeneratedannotation withCLASSretention (like the now-defunctjavax.annotation.Generated): Lombok, Immutables, someone asked it for jOOQ, someone else for MapStruct, and I'm sure there are (many) others.Configure Google Error Prone static code analysis tool
Configure Google Error Prone static code analysis tool (#8879)
cushon commentedon Jan 7, 2021
#1984 is a related bug about
org.immutables(which I think is supposed to try to use thejavax.*annotations if they're available, but doesn't seem to be doing that).Accept any annotation with the simple name `@Generated`
Accept any annotation with the simple name `@Generated`
cushon commentedon Jan 20, 2021
Done: 4d6a0cc
That doesn't solve all of our problems with lombok (see #1250 (comment) for current thoughts on that), but it should be enough to recognize lombok's annotation in
-XepDisableWarningsInGeneratedCode-XepDisableWarningsInGeneratedCode now supports all annotations named @…
Configure Google Error Prone static code analysis tool (#8879)