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

Enhance Collection.addAll(Collection<? extends E> c) to accept varargs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 8
    • core-libs

      A DESCRIPTION OF THE REQUEST :
      Add to java.util.Collection<E>:

      default boolean addAll(E... elements) {
         return addAll(Arrays.asList(elements));
      }

      JUSTIFICATION :
      Collection.addAll(elements) would be much more concise and readable than Collection.addAll(Arrays.asList(elements)), especially when one has many arrays to combine in a Collection.


            smarks Stuart Marks
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: