RFR 8075939: Stream.flatMap() causes breaking of short-circuiting of terminal operations
forax at univ-mlv.fr
Thu Dec 21 23:46:57 UTC 2017
- I think you should add a comment to explain why you have chosen to create a the field downstream* in the primitive implementations,
I suppose it's to avoid to allocate a lambda proxy at each call.
- the fields in the inner classes cancellationRequested and downstream* should be private.
- if you use var, you should use a meaningful name, here, 's' can be replaced by 'spliterator', making the code more readable.
----- Mail original -----
> De: "Paul Sandoz" <paul.sandoz at oracle.com>
> À: "core-libs-dev" <core-libs-dev at openjdk.java.net>
> Envoyé: Jeudi 21 Décembre 2017 23:40:18
> Objet:  RFR 8075939: Stream.flatMap() causes breaking of short-circuiting of terminal operations
> Please review the following webrev that makes flatMap non-aggressive when
> pushing elements downstream if any downstream operation is short-circuiting.
> This enables support for flat mapping to an infinite stream (assuming there is a
> downstream short-circuiting operation to terminate the stream computation).
More information about the core-libs-dev