On Wed, 27 Mar 2024 17:36:28 GMT, Liam Miller-Cushon <cus...@openjdk.org> wrote:

> This change overrides mutator methods in the implementation returned by 
> `Map.of().entrySet()` to throw `UnsupportedOperationException`.

src/java.base/share/classes/java/util/ImmutableCollections.java line 1321:

> 1319:                 }
> 1320: 
> 1321:                 // all mutating methods throw 
> UnsupportedOperationException

Can we change this anonymous class to `return new AbstractImmutableSet<>` and 
override `hashCode` with `MapN.this.hashCode()`?

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

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

Reply via email to