mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[lombok] IDEA-292093 Fix @NonNull on package does not work on Lombok methods
GitOrigin-RevId: 19acc4f9803e8b444e787de482da60cba1c58a19
This commit is contained in:
committed by
intellij-monorepo-bot
parent
82b30feb4e
commit
b61e5aa1a0
@@ -0,0 +1,33 @@
|
||||
package test;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
//IDEA-292093 @NonNullApi does not work on Lombok methods
|
||||
public class SpringNonNullApiOnPackage {
|
||||
public void test() {
|
||||
// These trigger the "Passing 'null' argument to parameter annotated as @NotNull" inspection
|
||||
var a = new Explicit(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>).setNn(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
|
||||
var b = <warning descr="Condition 'a == null' is always 'false'">a == null</warning>;
|
||||
|
||||
// These do not
|
||||
var c = new Lombok(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>).setNn(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
|
||||
var d = <warning descr="Condition 'c == null' is always 'false'">c == null</warning>;
|
||||
}
|
||||
}
|
||||
|
||||
class Explicit {
|
||||
public Explicit(String sexp) {
|
||||
}
|
||||
|
||||
public String setNn(String s) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
class Lombok {
|
||||
private String nn;
|
||||
private final String slom;
|
||||
}
|
||||
Reference in New Issue
Block a user