-
Bug
-
Resolution: Duplicate
-
P5
-
None
-
6
-
generic
-
generic
See also specification bug 6559178.
Also, it feels that the following (up)cast scenario should be flagged as
unchecked:
public class X<R> {
static interface Interface extends Comparable<String> {}
static final class Implements implements Interface {
public int compareTo(String o) {
return 0;
}
}
void method() {
((Comparable<R>) new Implements()).toString(); // unchecked ?
}
}
Also, it feels that the following (up)cast scenario should be flagged as
unchecked:
public class X<R> {
static interface Interface extends Comparable<String> {}
static final class Implements implements Interface {
public int compareTo(String o) {
return 0;
}
}
void method() {
((Comparable<R>) new Implements()).toString(); // unchecked ?
}
}
- duplicates
-
JDK-6467183 javac fails to raise unchecked warning on cast of parameterized generic subclass
- Closed
- relates to
-
JDK-6790039 overhaul cast-conversion (umbrella)
- Closed
-
JDK-6559178 upcast can never yield an unchecked warning
- Closed