JDK-4916620 : legal cast is rejected
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,linux,solaris_8,windows_2000,windows_xp
  • CPU: generic,x86
  • Submitted: 2003-09-03
  • Updated: 2017-05-16
  • Resolved: 2005-09-30
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 Availabitlity Release.

To download the current JDK release, click here.
Other JDK 6
5.0u8Fixed 6 b55Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The following cast is legal yet rejected:

class X {
    static class BB<T, S> { }
    static class BD<T> extends BB<T, T> { }
    void f() {
        BB<? extends Number, ? super Integer> bb = null;
        Object o = (BD<Number>) bb; // <<warn>> <<todo: cast-infer>>
    }
}

Comments
EVALUATION This fix is scheduled for Mustang beta. While this fix mostly causes javac to accept more programs (which javac previously rejected), there is a certain case of cast that will be rejected. For more details see bug 6302956.
2005-09-26

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon mustang
2004-09-07

PUBLIC COMMENTS ...
2004-09-07

EVALUATION This looks like a bug ###@###.### 2003-09-05
2003-09-05