Skip to content
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

False positive result of [EI_EXPOSE_REP] for lombok auto-generated code #731

Open
akkie76 opened this issue May 12, 2022 · 2 comments
Open

Comments

@akkie76
Copy link

akkie76 commented May 12, 2022

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.

@akkie76 akkie76 changed the title False positive result of [EI_EXPOSE_REP] False positive result of [EI_EXPOSE_REP] for lombok auto-generated code May 12, 2022
@KengoTODA
Copy link
Member

I guess what you need is spotbugs/spotbugs#1385, you may vote or submit a PR to realize it in the SpotBugs core.

@DeepController
Copy link

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

maisonobe added a commit to Hipparchus-Math/hipparchus that referenced this issue Apr 24, 2023
These false positives correspond to regular object oriented design.
SpotBugs has just become too stringent (see
spotbugs/spotbugs#1601,
       spotbugs/spotbugs#1771,
spotbugs/spotbugs#2083,
       spotbugs/spotbugs#2344,
spotbugs/spotbugs#2356,
       spotbugs/spotbugs-gradle-plugin#731)
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

No branches or pull requests

3 participants