mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
DFA: instanceof for unknown variable still may perform declared type check
Fixes IDEA-191374 DFA: "condition `x instanceof X` can be replaced with a null check" is not reported
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// IDEA-191374
|
||||
class B {}
|
||||
class A {
|
||||
private B b = new B();
|
||||
void foo() {
|
||||
String s = b != null ? b.toString() : ""; //comment this line and the error will appear
|
||||
|
||||
if (<warning descr="Condition 'b instanceof B' is redundant and can be replaced with a null check">b instanceof B</warning>) { // no error reported here
|
||||
System.out.println(b);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user