JDK-6559179 : Unchecked upcast not identified
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2007-05-18
  • Updated: 2010-04-02
  • Resolved: 2009-03-13
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
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 ?
      }
}