-
Bug
-
Resolution: Duplicate
-
P5
-
None
-
6
-
generic
-
generic
This should cause a warning.
class Pair<X,Y> {}
class ObjectPair extends Pair<Object,Object> {}
class Test<X,Y>{
public Pair<X,Y> m() {
return (Pair<X,Y>)new ObjectPair(); // warning missing here
}
public static void main(String[] args) {
Test<String,String> t = new Test<String,String>();
Pair<String,String> pss = t.m();
}
}
class Pair<X,Y> {}
class ObjectPair extends Pair<Object,Object> {}
class Test<X,Y>{
public Pair<X,Y> m() {
return (Pair<X,Y>)new ObjectPair(); // warning missing here
}
public static void main(String[] args) {
Test<String,String> t = new Test<String,String>();
Pair<String,String> pss = t.m();
}
}
- 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