JDK-6558569 : Missing unchecked warning
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2007-05-17
  • Updated: 2010-04-02
  • Resolved: 2009-03-13
Related Reports
Duplicate :  
Relates :  
Description
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();
    }
}