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
(Skip to the "Sample code" section; nobody wants to read this complicated "short" description)
When a lazy getter field is initialized by an expression that references a constructor-initialized final field, a ConstantConditions inspection ("dereference of *** may produce NPE") is triggered. Had the field not been a lazy getter, this would indeed have been possible, but since lazy getters can only be possibly called after initialization (it would have been unreasonable to make it a lazy getter if it is called immediately), such NPE is not practically possible.
Expected behavior
The plugin should stop the IDE from identifying the lazy initializer expression as something executed before constructor call.
Version information
IDEA Version: IntelliJ IDEA 173.4528.2 (2017.3.4 EAP Ultimate)
JDK Version: JRE 1.8.0_152-release-1024-b11 amd64; JVM OpenJDK 64-bit Server VM by JetBrains
To be sure, I made IDEA inspect the decompiled code, and it indeed triggers no inspection with the decompiled code. On the other hand, I get this with the original code:
Other information
If you fail to reproduce the problem and want more information, please provide a private means of communication. I don't want to disclose my project details to the public.
The text was updated successfully, but these errors were encountered:
Short description
(Skip to the "Sample code" section; nobody wants to read this complicated "short" description)
When a lazy getter field is initialized by an expression that references a constructor-initialized final field, a ConstantConditions inspection ("dereference of *** may produce NPE") is triggered. Had the field not been a lazy getter, this would indeed have been possible, but since lazy getters can only be possibly called after initialization (it would have been unreasonable to make it a lazy getter if it is called immediately), such NPE is not practically possible.
Expected behavior
The plugin should stop the IDE from identifying the lazy initializer expression as something executed before constructor call.
Version information
org.projectlombok:lombok:1.16.20
Sample code
Consider this example class:
The
Bar
class is an empty class.The decompiled .class becomes this:
To be sure, I made IDEA inspect the decompiled code, and it indeed triggers no inspection with the decompiled code. On the other hand, I get this with the original code:
Other information
If you fail to reproduce the problem and want more information, please provide a private means of communication. I don't want to disclose my project details to the public.
The text was updated successfully, but these errors were encountered: