RFR(s): 8060192: Add default method Collection.toArray(generator)

Martin Buchholz martinrb at google.com
Tue Dec 5 04:05:41 UTC 2017


+    // no spec changes relative to supertype
+    public <T> T[] toArray(IntFunction<T[]> generator) {

You probably at least need @inheritDoc for the unchecked exception throws
(as I've forgotten many times)

On Mon, Dec 4, 2017 at 7:20 PM, Stuart Marks <stuart.marks at oracle.com>
wrote:

> Hi all,
>
> Please review this small enhancement to add a default method
> Collection.toArray(generator) that takes a function that creates the
> destination array. This is analogous to Stream.toArray(generator).
>
> Bug:
>
>     https://bugs.openjdk.java.net/browse/JDK-8060192
>
> Webrev:
>
>     http://cr.openjdk.java.net/~smarks/reviews/8060192/webrev.0/
>
> Thanks,
>
> s'marks
>


More information about the core-libs-dev mailing list