mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
dfa: store CCE state in visitor, not runner: the latter is reused which can result in multiple warning
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
class X {
|
||||
public static void main(Object result) {
|
||||
final boolean varargs = result instanceof Intf;
|
||||
new Runnable() {
|
||||
public void run() { }
|
||||
};
|
||||
Intf a = (<warning descr="Casting 'result' to 'Intf' may produce 'java.lang.ClassCastException'">Intf</warning>)result;
|
||||
}
|
||||
|
||||
public static void main2(Object result) {
|
||||
final boolean varargs = result instanceof Intf;
|
||||
if (!varargs) return;
|
||||
new Runnable() {
|
||||
public void run() { }
|
||||
};
|
||||
if (<warning descr="Condition 'result instanceof Intf' is always 'true'">result instanceof Intf</warning>) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
||||
interface Intf {}
|
||||
Reference in New Issue
Block a user