RFR 8071600: Add a flat-mapping collector
Paul Sandoz
paul.sandoz at oracle.com
Thu Feb 12 15:06:42 UTC 2015
On Feb 12, 2015, at 3:33 PM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
> On 3 Feb 2015, at 13:48, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>
>> Hi,
>>
>> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8071600-Collector-flatMapping/webrev/
>
> Looks like a useful addition.
>
Thanks.
> Trivially, the handling of null caught my eye: "If a mapped stream is {@code null} an empty stream is used, instead.” It looks like the result of the mapper function returning null is equivalent to it returning an empty stream, but I’m not sure that I see an empty stream being used in the implementation.
Right, and the caller cannot tell the difference, since in either case no elements will be pushed downstream.
> Is this just a convenience, for implementers of the mapping function?
>
Yes, the sentence makes most sense in the context of what comes before it.
Paul.
More information about the core-libs-dev
mailing list