palantir / gradle-processors

Gradle plugin for integrating Java annotation processors
Apache License 2.0
63 stars 23 forks source link

should use a different method to exclude generated classes from FindBugs #47

Closed j-baker closed 7 years ago

j-baker commented 8 years ago

at the moment, we remove the generated classes from the findbugs classpath; but this can be problematic if other classes need them (e.g. antipatterns). We should instead find a way to have Findbugs simply ignore the results of analysing the classes.

henryptung commented 7 years ago

@j-baker @chrisalice Immutables has since started adding @SuppressFBWarnings to all its generated classes (as long as the appropriate annotation is available on classpath); this seems like a much more sustainable way to handle this problem, unless someone knows of another annotation processor that doesn't apply this annotation.

At the same time, this code currently breaks usage of @Value.Enclosing immutables, since Findbugs will scan the inner classes without the presence of the wrapping outer classes (and gets extremely confused doing so). Also, a bunch of warnings are output by Findbugs when this happens.

I'd vote for a simple removal of the code, to (1) remove some complexity and (2) make the plugin behavior less mysterious.

alicederyn commented 7 years ago

This should now be fixed as of v1.2.10