First element of a parallel stream? +possible bug report
Paul Sandoz
paul.sandoz at oracle.com
Tue Dec 4 13:01:00 PST 2012
On Dec 4, 2012, at 3:05 PM, Dmitry Bessonov <dmitry.bessonov at oracle.com> wrote:
> 1)Question:
>
> Is the result of the following chain of operations defined
> and should be the same on all hardware/implementations?
>
> Arrays.asList("first", "second", "last").parallel().findFirst();
>
Yes, it will return the same result as for stream().findFirst().
>
> 2) Report: Slightly modified version throws NPE
> (with the yesterday's state of the repo) :
>
> Arrays.asList("first", "second", null, "last").parallel().findFirst();
>
Right, Optional is totally null intolerant at the moment.
Paul.
More information about the lambda-dev
mailing list