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

generics + varargs API changes

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b49
    • CPU:
      generic
    • OS:
      solaris_8

      Description

      Due to 5009693 (an integration of the various Tiger language features
      into the JLS), a varargs method may now be generic. jsr14 and jsr201
      strongly recommend retrofitting the following methods with varargs:

      In java.util.Arrays:

         static <T> List<T> asList(T[] a)

      In java.util.Collections:

         static <T> boolean addAll(Collection<? super T> c, T[] a)

      And in EnumSet, the "of" static factory by adding

         public static <E extends Enum<E>> EnumSet<E> EnumSet.of(E e, E... e);

      This latter method, due to overloading, will only be invoked when six
      or more enumeration constants are given as arguments.

        Attachments

          Activity

            People

            Assignee:
            gafter Neal Gafter
            Reporter:
            gafter Neal Gafter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: