RFR: 8266571: Sequenced Collections [v6]

Stuart Marks smarks at openjdk.org
Wed Apr 19 02:18:11 UTC 2023


On Fri, 24 Mar 2023 21:57:40 GMT, Tagir F. Valeev <tvaleev at openjdk.org> wrote:

>> Stuart Marks has updated the pull request incrementally with four additional commits since the last revision:
>> 
>>  - Clarify LHM and LHS specs regarding semantics of reverse-ordered views.
>>  - Remove special-cases for reversed LHM and LHS putAll and add.
>>  - Minor cleanups including formatting, naming, comments, modifiers.
>>  - Add @implSpec to default methods where it was missing.
>>    Add removeFirst/removeLast default methods to NavigableSet.
>>    Add throwing putFirst/putLast to TreeMap & ConcurrentSkipListMap
>>    Add throwing addFirst/addLast to TreeSet & ConcurrentSkipListSet
>>    Clarify access order specification for LinkedHashMap.
>
> src/java.base/share/classes/java/util/ReverseOrderDequeView.java line 103:
> 
>> 101:     }
>> 102: 
>> 103:     // copied from AbstractCollection
> 
> Probably not the part of this PR, but it could be reasonable to create some utility CollectionSupport class and create static methods (e.g. `static boolean remove(Collection<?> c, Object o)`) with the implementations of common collection algorithms, like this one. WDYT?

Probably. I think I'll definitely need to do that with the spliterators, and likely also with other interating and bulk operations such as this one. But yes, not part of this PR.

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

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


More information about the core-libs-dev mailing list