Description:
Runtime type of the expression (computed by dataflow analysis) is not compatible with
target type of cast or instanceof operators. Been exceuted such cast operator will throw
java.lang.ClassCastException at runtime and instanceof operator will always return false.
Not compatible here means that neither actual type of the expression is the same or is
subclass of target type of cast ot instance of operator, neither target type is sublcass of
expression type.
Example:
class A {
...
}
class B {
...
}
...
void foo(Object o) {
if (o instanceof A) { // runtime type of o is now A
((B)o).someMethod(); // cast cause exception at runtime because
// o can not be derived from B
}
}