mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
[lombok] IDEA-255688 Using existing functionality to skip checking expressions from field initializer
and to skip checking field initializer expression GitOrigin-RevId: 67211ecbad65889dabe6385678cc1b7c47a96deb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7b19a2dd37
commit
4222be044e
@@ -14,6 +14,7 @@ public class GetterLazyInvocationProduceNPE {
|
||||
}
|
||||
|
||||
private Bar <warning descr="Field 'bar' may be 'final'">bar</warning>;
|
||||
private Bar <warning descr="Private field 'bar2' is never assigned">bar2</warning>;
|
||||
private Car car;
|
||||
|
||||
public GetterLazyInvocationProduceNPE(Bar bar, Car car) {
|
||||
@@ -21,11 +22,15 @@ public class GetterLazyInvocationProduceNPE {
|
||||
this.car = car;
|
||||
}
|
||||
|
||||
// without warning
|
||||
// without warning, because of lazy getter and initialized in constructor
|
||||
@Getter(lazy = true)
|
||||
private final String barString = bar.sayHello();
|
||||
|
||||
//with warning!
|
||||
// with warning, because of lazy getter and NOT initialized in constructor
|
||||
@Getter(lazy = true)
|
||||
private final String bar2String = bar2.<warning descr="Method invocation 'sayHello' will produce 'NullPointerException'">sayHello</warning>();
|
||||
|
||||
//with warning, because of NOT lazy getter
|
||||
@Getter
|
||||
private final String carString = car.<warning descr="Method invocation 'sayHello' will produce 'NullPointerException'">sayHello</warning>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user