Open
Description
UseInstanceofToCompareClasses reports on non-reifiable types, even though they're not acceptable as operand to instanceof
. E.g.:
class Foo<T> {
public Foo<T> wrap() {
// since the local class is not static, the T here refers to the T of the outer instance
class MyWrapper extends Foo<T> {
}
this instanceof MyWrapper // -> error, MyWrapper is not reifiable, because its supertype Foo<T> isn't
this.getClass().equals(MyWrapper.class) // this is the only way to compare it
}
}
Metadata
Metadata
Assignees
Labels
No labels