On Sat, 14 Aug 2021 00:53:06 GMT, liach <github.com+7806504+li...@openjdk.org> 
wrote:

> Aren't all iterable implementations effectively streamable if they properly 
> implement `spliterator`? And the spliterator implementation can always be 
> sequential or parallel, dependent on how you feed it into `StreamSupport`.

Yes indeed, but to add extra methods to the Iterable interface itself could 
have compatibility or possible security issues depending on whether these 
methods are abstract or not resp.

Therefore I made it a fully separate interface here and used it in places with 
known implementations (Collection and Optional) so that there's no changes in 
the exposed API of the other classes. The only difference is that you can now 
make use of the fact that these interfaces extend Streamable and/or 
ParallelStreamable

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

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

Reply via email to