RFR: 8272137: Make Collection and Optional classes streamable

CC007 github.com+5381337+cc007 at openjdk.java.net
Tue Aug 17 04:17:28 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

The List and Collection interface was almost directly taken from java.util (apart from the small feature interfaces, that I extracted from them), so it would make sense that those classes use an older design.

Are you suggesting that there are deeper architectural issues with the hierarchy-heavy collection stack? Would it be better if a list contained a collection, rather than inheriting from it? If that is the case, anything that is proposed in this PR is merely aiming at symptoms of a possibility much larger underlying problem, which might require going back to the drawing board for all collection related features.

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

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


More information about the core-libs-dev mailing list