RFR: 8328821: Map.of() derived view collection mutators should throw UnsupportedOperationException [v14]
Liam Miller-Cushon
cushon at openjdk.org
Thu Nov 27 14:14:13 UTC 2025
On Thu, 27 Nov 2025 09:41:35 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:
>> This change overrides mutator methods in the implementation returned by `Map.of().entrySet()` to throw `UnsupportedOperationException`.
>
> Liam Miller-Cushon has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits:
>
> - Merge commit 'f94644999766e752f7d60ce52c14a7db79005035^' into JDK-8328821-make-clear-consistent
> - Add an implementation comment to AbstractImmutableMap
> - Update for Stable Values
> - Merge remote-tracking branch 'origin/master' into JDK-8328821-make-clear-consistent
> - Merge remote-tracking branch 'origin/master' into JDK-8328821-make-clear-consistent
> - Merge remote-tracking branch 'origin/master' into JDK-8328821-make-clear-consistent
> - Merge remote-tracking branch 'origin/master' into JDK-8328821-make-clear-consistent
> - Update test/jdk/java/util/Collection/MOAT.java
>
> Co-authored-by: Chen Liang <liach at openjdk.org>
> - Update copyright year
>
> and add the bug number to the modified test
> - Update unmodifiable map javadoc
> - ... and 8 more: https://git.openjdk.org/jdk/compare/df5b105b...ab5dab9a
I resolve some merge conflicts with JEP 526. The previous JEP 502 implementation needed some changes here to ensure the derived view collections throw UOE, for JEP 526 it looks like that was fixed and no changes are necessary.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18522#issuecomment-3586075463
More information about the core-libs-dev
mailing list