Files
openide/java/java-tests/testData/inspection/dataFlow/fixture/NullCheckBeforeInstanceof.java
2013-09-13 18:20:15 +04:00

24 lines
625 B
Java

class Doo {
final Object finalField;
Object mutableField;
Foo(Object finalField) {
this.finalField = finalField;
}
Object method() { return new Object(); }
public void foo(final Object o) {
if (o != null && o instanceof String) {}
if (finalField != null && o instanceof String) {}
if (finalField != null) {
if (finalField instanceof String) {}
}
if (finalField != null) {
if (finalField instanceof String) {}
System.out.println();
}
if (mutableField != null && mutableField instanceof String) {}
if (method() != null && method() instanceof String) {}
}
}