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

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: