JDK-6240565 : Unboxing, arrays, and type variables doesn't work
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-03-15
  • Updated: 2010-04-02
  • Resolved: 2006-02-04
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.
JDK 6
6 b71Fixed
Related Reports
Relates :  
Relates :  
Description
public class Tester {
    public static <E extends Integer> void doit ( final E[] a ) {
	System.out.println ( a[0] / 4 ) ;
    }
    public static void main ( final String[] args ) {
	Tester.doit ( new Integer[] { 2 , 3 , 4 } ) ;            
    }
}

Tester.java:3: cannot find symbol
symbol  : method intValue()
location: bound of type variable E
        System.out.println ( a[0] / 4 ) ;
                              ^
Fatal Error: Unable to find method intValue

###@###.### 2005-03-15 02:24:25 GMT

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/langtools_data/mustang/6240565
28-12-2005

EVALUATION Yes, this is a bug. However, there is really no good reason for creating type variables bounded by Integer, so fixing this is not urgent. ###@###.### 2005-03-15 02:24:25 GMT
15-03-2005