RFR: 8266571: Sequenced Collections [v12]

Stuart Marks smarks at openjdk.org
Tue Apr 25 00:49:34 UTC 2023


On Fri, 24 Mar 2023 22:08:18 GMT, Tagir F. Valeev <tvaleev at openjdk.org> wrote:

>> Stuart Marks has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 96 commits:
>> 
>>  - Merge branch 'master' into JDK-8266571-SequencedCollections
>>  - Optimizations for ReverseOrderListView; check indexes in reversed domain.
>>  - Wording tweaks to SequencedMap / NavigableMap.
>>  - Change "The implementation in this class" to "... interface."
>>  - Delegate more methods in the views of ReverseOrderSortedMapView.
>>  - Add missing @throws and @since tags.
>>  - Convert code samples to snippets.
>>  - Various editorial changes.
>>  - Fix up toArray(T[]) on reverse-ordered views.
>>  - Remove unnecessary 'final' from a couple places.
>>  - ... and 86 more: https://git.openjdk.org/jdk/compare/2ea62c13...2827aa69
>
> src/java.base/share/classes/java/util/ReverseOrderListView.java line 316:
> 
>> 314:     public void add(int index, E element) {
>> 315:         checkModifiable();
>> 316:         base.add(base.size() - index, element);
> 
> Note that if index is out of bounds, the original collection may throw a confusing exception, as `base.size() - index` will be reported instead. Probably adding explicit bounds checking call before delegation would be better. Same applies to other index-based operations.

Fixed.

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

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


More information about the core-libs-dev mailing list