spotbugs-gradle-plugin
spotbugs-gradle-plugin copied to clipboard
False positive result of [EI_EXPOSE_REP] for lombok auto-generated code
Hi,
I set spotbugs ver 4.7.0 and executed Task: spotbugsMain, but the auto-generated code of lombok detected EI_EXPOSE_REP and EI_EXPOSE_REP2.
So, I have to write the setter and getter code by myself. Is not successful for lombok auto-generated code.
We have confirmed that this occurs in ver 4.3.0 or later.
I don't think lombok auto-generated code is subject to spotbugsMain, so is it possible to avoid warning about them?
- Target version
- 4.3.0 ~
Best Regards.
I guess what you need is https://github.com/spotbugs/spotbugs/issues/1385, you may vote or submit a PR to realize it in the SpotBugs core.
Add the following lines in to your lombok.config file, so that lombok generated code suppress SpotBugs warning.
# Suppress FindBugs/SpotBugs error for Lombok generated code.
lombok.extern.findbugs.addSuppressFBWarnings = true