RFR: 8358015: Fix SequencedMap sequenced view method specifications

Stuart Marks smarks at openjdk.org
Fri May 30 22:48:52 UTC 2025


On Fri, 30 May 2025 14:33:05 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> For a full explanation, see the bug report [JDK-8358015](https://bugs.openjdk.org/browse/JDK-8358015).
>> 
>> This PR includes three related changes:
>> * New overrides in SequencedMap view collection implementations, which improve their behavior.
>> * Update to `@implSpec` clauses to reflect this behavior (which was previously ill-specified).
>> * Update to a test which relied on unspecified behavior.
>
> src/java.base/share/classes/java/util/SequencedMap.java line 271:
> 
>> 269:      * Its {@link SequencedSet#getFirst getFirst} and {@link SequencedSet#getLast getLast}
>> 270:      * methods are implemented in terms of the {@link #firstEntry firstEntry} and {@link
>> 271:      * #lastEntry lastEntry} methods of this class, respectively. Its {@link
> 
> Hello Stuart, some parts of this and other updated method docs use "this interface", "this map", "this class". Was it intentional to use "this class" in this newly added text?

Good point. The other `@implSpec` clauses here all say "this interface" so I'll change the newly added "this class" to "this interface" in order to try to avoid confusion.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25515#discussion_r2116834181


More information about the core-libs-dev mailing list