RFR: 8328821: Map.of() derived view collection mutators should throw UnsupportedOperationException [v8]

Liam Miller-Cushon cushon at openjdk.org
Mon Dec 2 16:50:20 UTC 2024


> 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 incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision:

 - 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
 - Also throw UOE for mutators on keySet() and values()
   
   and add more test coverage to MOAT.
 - Merge remote-tracking branch 'origin/master' into JDK-8328821-make-clear-consistent
 - Merge remote-tracking branch 'origin/master' into JDK-8328821-make-clear-consistent
 - Check m.entrySet().hashCode() in MOAT
 - Merge remote-tracking branch 'origin/master' into JDK-8328821-make-clear-consistent
 - Use AbstractImmutableSet
 - ... and 2 more: https://git.openjdk.org/jdk/compare/bd27d6b4...223164c4

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/18522/files
  - new: https://git.openjdk.org/jdk/pull/18522/files/3acac325..223164c4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=18522&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=18522&range=06-07

  Stats: 867707 lines in 10170 files changed: 548632 ins; 248647 del; 70428 mod
  Patch: https://git.openjdk.org/jdk/pull/18522.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18522/head:pull/18522

PR: https://git.openjdk.org/jdk/pull/18522


More information about the core-libs-dev mailing list