mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
an index to detect nulls passed as arguments of method parameters + DataFlowInspection and NullableStuffInspection use it to detect method call failings when one of parameters is null
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class Test {
|
||||
void someMethod(<warning descr="Parameter annotated @NotNull should not receive null as an argument">@NotNull</warning> Object warn, <warning descr="Parameter annotated @NotNull should not receive null as an argument">@NotNull</warning> Object o2, <warning descr="Parameter annotated @NotNull should not receive null as an argument">@NotNull</warning> Object warn1) {
|
||||
|
||||
}
|
||||
|
||||
static void someStaticMethod(Object notAnnotated, <warning descr="Parameter annotated @NotNull should not receive null as an argument">@NotNull</warning> Object o2, <warning descr="Parameter annotated @NotNull should not receive null as an argument">@NotNull</warning> Object warn2) {
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
someStaticMethod(null, "", "");
|
||||
|
||||
Test.someStaticMethod("", null, null);
|
||||
|
||||
new Test().someMethod("", null, null);
|
||||
|
||||
Test m = new Test();
|
||||
|
||||
m.someMethod(null, "", "");
|
||||
m.someMethod(null, "", "");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user