Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6240565

Unboxing, arrays, and type variables doesn't work

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b71
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ahe Peter Ahe
              Reporter:
              ahe Peter Ahe
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: