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

Stream.toArray(IntFunction) ArrayStoreException should refer to component type of array

XMLWordPrintable

    • b35
    • Not verified

      Collection.toArray(T[] ), plus from overriding classes, states:

           * @throws ArrayStoreException if the runtime type of the specified array
           * is not a supertype of the runtime type of every element in
           * this collection

       and Stream.toArray(IntFunction<A[]> ) state:

           * @throws ArrayStoreException if the runtime type of the array returned
           * from the array generator is not a supertype of the runtime type of every
           * element in this stream

      Rather than "runtime type" it should more accurately be "component type"

            psandoz Paul Sandoz
            psandoz Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: