JDK-5046972 : type parameter referenced in static inner class improperly allowed!
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: generic
  • Submitted: 2004-05-13
  • Updated: 2004-05-28
  • Resolved: 2004-05-28
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
5.0 b54Fixed
Related Reports
Relates :  
Description
The following should give an error: type parameters K and V aren't in scope
in the extends clause of Bucket because Bucket is a static nested class.  Yet
the compiler allows it.



import java.util.*;

class MPair<A,B> {}

class Test<K,V> {
    private static class Bucket extends LinkedList<MPair<K,V>> {}
    private Bucket[] buckets = new Test.Bucket[100];
}

Comments
SUGGESTED FIX Webrev of changes: http://javac.sfbay/java/jdk/ws/tools/gjc/FIXES/2004/05/24/5046972/webrev/
31-10-2006

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-rc FIXED IN: tiger-rc INTEGRATED IN: tiger-b54 tiger-rc
14-06-2004

PUBLIC COMMENTS ...
10-06-2004

EVALUATION We've already had one external user attempt to rely on this misfeature. Fixing it later would therefore introduce a backward incompatibility. Moreover, this introduces a loophole in the generic type system. ###@###.### 2004-05-17
17-05-2004