RFR: 8266571: Sequenced Collections [v2]

Rémi Forax forax at openjdk.org
Wed Mar 29 09:55:07 UTC 2023


On Wed, 29 Mar 2023 06:52:35 GMT, ExE Boss <duke at openjdk.org> wrote:

> There is SortedMap, 
yes, but no sorted "collection". An interface with a special semantic for set, map or list do not have the same impact in term of number of lines to maintain than a collection with a special semantics.

And java.util.Collection is a kind like java.lang.Object, it does not define a real semantics, equals/hashCode are defined in set and list not collection, so it's more that Collection is defined by its lack of semantics. So the same way, it's weird to have two java.lang.Object, it's weird to have two Collections.

> and non‑null collection interfaces are unnecessary with JEP Null‑Restricted and Nullable Types
i think we are agreeing here, there is no need for a special interface for non-null collections, so why do we need one for ordered collections.

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

PR Comment: https://git.openjdk.org/jdk/pull/7387#issuecomment-1488287644



More information about the client-libs-dev mailing list