mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
IDEA-89964 Constant conditions & exceptions inspection is incorrect with instance checks in loops
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
public class Test {
|
||||
|
||||
public static void main(Object[] args) throws Exception {
|
||||
boolean elvisLives = false;
|
||||
for (final Object o : args) {
|
||||
if (o instanceof Integer) {
|
||||
elvisLives = true;
|
||||
} else {
|
||||
if (elvisLives) {
|
||||
System.err.println("Elvis is alive!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user