IDEA-89964 Constant conditions & exceptions inspection is incorrect with instance checks in loops

This commit is contained in:
peter
2012-09-10 14:15:41 +02:00
parent b8d339d1e3
commit d13b70d875
3 changed files with 19 additions and 1 deletions
@@ -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!");
}
}
}
}
}