JDK-6295056 : Unchecked cast not reported as unsafe
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2005-07-08
  • Updated: 2010-04-02
  • Resolved: 2005-09-15
Related Reports
Duplicate :  
Description
This program compiles without warnings:

interface Foo {}
interface Bar<X> {}
class Test {
    Object m(Foo f) {
        return (Bar<Object>)f;
    }
}

See also http://forum.java.sun.com/thread.jspa?threadID=642516

###@###.### 2005-07-08 17:34:34 GMT

Comments
EVALUATION This is a bug. The cast should be reported as unchecked. ###@###.### 2005-07-08 17:34:34 GMT
08-07-2005