mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-97313 @Nullable inspection does not warn on dereferencing @Nullable variable declared in foreach loop
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import foo.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Foo {
|
||||
void foo1(List<Integer> list) {
|
||||
for (@Nullable Integer i : list) {
|
||||
System.out.println(<warning descr="Method invocation 'i.intValue()' may produce 'java.lang.NullPointerException'">i.intValue()</warning>);
|
||||
}
|
||||
}
|
||||
void foo2(List<@Nullable Integer> list) {
|
||||
for (@Nullable Integer i : list) {
|
||||
System.out.println(<warning descr="Method invocation 'i.intValue()' may produce 'java.lang.NullPointerException'">i.intValue()</warning>);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user