On Tue, 9 Jul 2024 19:19:41 GMT, Liam Miller-Cushon <cus...@openjdk.org> wrote:

>> There is `testImmutableCollection`/`testImmutableSet` that takes an 
>> arbitrary nonexistent item for insertion/removal: 
>> https://github.com/openjdk/jdk/blob/598af2e51464be089b64da4024e62865c2c6ec72/test/jdk/java/util/Collection/MOAT.java#L665
>> I think a refactor of a generic `testCollMutatorsAlwaysThrow(Collection<T> 
>> c, T t)` and delegating the original Integer version to call 
>> `testCollMutatorsAlwaysThrow(c, ABSENT_VALUE)` would not be invasive.
>
> Thanks! Done.
> 
> That pointed out that the mutators on `keySet()` and `values()` were not 
> throwing UOE, so I have tentatively updated the PR to also fix that.

Thank you for this more comprehensive update! Definitely an improvement to 
bring the UOE behavior to all 3 of these view collections.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18522#discussion_r1671043314

Reply via email to