On Sat, 22 Apr 2023 09:33:57 GMT, ExE Boss <d...@openjdk.org> wrote:

>> Stuart Marks has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - Wording tweaks to SequencedMap / NavigableMap.
>>  - Change "The implementation in this class" to "... interface."
>
> src/java.base/share/classes/java/util/SortedMap.java line 113:
> 
>> 111:  */
>> 112: 
>> 113: public interface SortedMap<K,V> extends SequencedMap<K,V> {
> 
> This interface can now provide default implementations for the `firstKey` and 
> `lastKey` methods:
> 
> default K firstKey() {
>       var entry = this.firstEntry();
>       if (entry == null) {
>               throw new NoSuchElementException();
>       }
>       return entry.getKey();
> }
> 
> 
> default K lastKey() {
>       var entry = this.lastEntry();
>       if (entry == null) {
>               throw new NoSuchElementException();
>       }
>       return entry.getKey();
> }

Doesn't seem all that useful.

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

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

Reply via email to