projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.93k stars 2.4k forks source link

lazy getter producing findbugs warnings #842

Open lombokissues opened 9 years ago

lombokissues commented 9 years ago

Migrated from Google Code (issue 807)

lombokissues commented 9 years ago

:bust_in_silhouette: chas@honton.org   :clock8: Apr 17, 2015 at 21:15 UTC

Please discuss feature requests first on https://groups.google.com/forum/﹟!forum/project-lombok

What steps will reproduce the problem?

  1. Use @ Getter(lazy = true) private final Foo = new Foo();
  2. Run findbugs on the generated code

What is the expected output? What do you see instead? Findbugs produces two warnings: JLM - Synchronization performed on java.util.concurrent.atomic.AtomicReference. RCN - Redundant nullcheck of actualValue, which is known to be non-null

What version of the product are you using? On what operating system? 1.16 on linux

Please provide any additional information below.

lombokissues commented 9 years ago

:bust_in_silhouette: Maaartinus   :clock8: Apr 18, 2015 at 14:33 UTC

JLM: This is an old story, see https://groups.google.com/d/msg/project-lombok/MLQ3I9XJR80/kckW_vEUTlwJ

RCN: No idea, I can't see it in https://projectlombok.org/features/GetterLazy.html

To keep findbugs shut, you can add this line to lombok.config: lombok.extern.findbugs.addSuppressFBWarnings=true

lombokissues commented 9 years ago

End of migration