RFR: 8266571: Sequenced Collections [v4]

Chen Liang liach at openjdk.org
Wed Mar 29 21:59:08 UTC 2023


On Wed, 29 Mar 2023 20:05:10 GMT, Rémi Forax <forax at openjdk.org> wrote:

>> @forax but this would not be a view: changes in the underlying collection won't be reflected
>
> Yes,
> The spec says :"Changes to the underlying collection might or might not be visible in this reversed view, depending upon the implementation." so i believe the default implementation i proposed is a valid implementation

In the JEP, it says:
> Any modifications to the original collection are visible in the view.

If we don't have an efficient reversed view, I don't see a point of declaring a collection sequenced; same reason for declaring a sequenced/deque vs. a full-on list with inefficient list random access operations.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r1152474419


More information about the core-libs-dev mailing list