JDK-6358534 : Cast involving raw superclass not recognized as unchecked
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-12-02
  • Updated: 2010-04-02
  • Resolved: 2006-01-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
5.0u7Resolved 6 b67Fixed
Related Reports
Relates :  
Description
This program doesn't compile:

interface MyInterface<V> { }
                 
class MyImpl implements MyInterface {
    MyInterface<Integer> o1 = (MyInterface<Integer>) (MyImpl)null;
    MyImpl o2 = (MyImpl) (MyInterface<Integer>)null;
}

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/langtools_data/mustang/6358534/
26-01-2006

SUGGESTED FIX --- /tmp/geta4866 2005-12-03 00:24:06.326797856 +0530 +++ src/share/classes/com/sun/tools/javac/code/Types.java 2005-12-03 00:24:04.947007616 +0530 @@ -898,7 +898,7 @@ return true; } } - return false; + return isSubTypeUnchecked(a, b, warn); } // Sidecast
02-12-2005

EVALUATION This is a bug and was caused by the changes for 4916620.
02-12-2005