unchecked casts: ignore extends wildcards with the same bound as corresponding type parameter bound (IDEA-71629)

This commit is contained in:
anna
2011-07-12 17:43:36 +04:00
parent f9a3dca568
commit 49d4914f57
2 changed files with 27 additions and 3 deletions
@@ -55,4 +55,18 @@ class M {
public static <T extends K> L f(T t) {
return (L) t; //this should NOT generate unchecked cast
}
}
}
class UncheckedCastFalsePositive {
public static void method(Object something) {
if (something instanceof NumberList) {
NumberList<? extends Number> <warning descr="Variable 'numberList' is never used">numberList</warning> = (NumberList<? extends Number>) something;
}
}
public static class NumberList<E extends Number> extends ArrayList<E> {
}
}