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

(coll) Add E[] toArray(Class<T>) so that an array instance is not required

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      A DESCRIPTION OF THE REQUEST :
      * Add E[] toArray(Class<T>) so that an array instance (like (Foo[])toArray(new Foo[0]) is not required). Get rid of E[] toArray(E[]).


      JUSTIFICATION :
      This is one of many RFEs produced from a community discussion at
      http://forums.java.net/jive/thread.jspa?threadID=143. Further
      justification could typically be found at the given link or off a
      thread listed at the given link.

      Why does one need to have an array instance for toArray (??). I see this as a deficiency in obtaining the class representation of an int array. Almost _every_ time i've seen toArray being used or being used by myself there has been a zero length array. E[] toArray(Class<E> classType) should be sufficent.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ahe Peter Ahe
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: