RFR: 8358015: Fix SequencedMap sequenced view method specifications [v2]

Joe Darcy darcy at openjdk.org
Mon Jun 2 20:43:52 UTC 2025


On Sat, 31 May 2025 00:47:16 GMT, Stuart Marks <smarks 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.
>
> Stuart Marks has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Tweak nsee() declaration; adjust specs per suggestion; update copyrights.

src/java.base/share/classes/java/util/SequencedMap.java line 296:

> 294:                 return view().hashCode();
> 295:             }
> 296:             public void addFirst(K k) { throw new UnsupportedOperationException(); }

Any utility in adding `@Override` annotations to the methods to document intent?

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

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


More information about the core-libs-dev mailing list