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

generics + varargs API changes

XMLWordPrintable

    • b49
    • generic
    • solaris_8

      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.

            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: