RFR: 8272137: Make Iterable classes streamable

Rémi Forax forax at openjdk.java.net
Sat Aug 14 09:59:24 UTC 2021


On Mon, 9 Aug 2021 12:28:23 GMT, CC007 <github.com+5381337+CC007 at openjdk.org> wrote:

> create Streamable and ParallelStreamable interface and use them in Collection and Optional

Hi Rick,
I do not think that such interfaces are a good addition to the JDK,
we do not want to promote the fact that you can create a Stream from an Iterable because the resulting Stream is not efficient (or is not as efficient as it could be) and we can already uses a Supplier<Stream> if we want to to represent a factory of streams

See my comment on the bug for more details

-------------

PR: https://git.openjdk.java.net/jdk/pull/5050


More information about the core-libs-dev mailing list