RFR: 8178355: IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)

liach duke at openjdk.java.net
Thu Apr 21 16:17:28 UTC 2022


On Thu, 21 Apr 2022 00:48:00 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>> Explicitly implement `remove` and `replace` in `IdentityHashMap` to compare values by identity. Updated API documentation of these two methods ([Preview](https://cr.openjdk.java.net/~liach/8178355/IdentityHashMap.html#remove(java.lang.Object,java.lang.Object))) to mention such behavior.
>
> Thanks for working on this. Yes I can review and sponsor this change.
> 
> Sorry I got a bit distracted. I started looking at the test here, and this lead me to inquire about what other tests we have for `IdentityHashMap`, and the answer is: not enough. See [JDK-8285295](https://bugs.openjdk.java.net/browse/JDK-8285295). (But that should be handled separately.)

@stuart-marks Updated. In addition, for API docs change, should we add apiNote on object equality code, like call computeIfPresent?

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

PR: https://git.openjdk.java.net/jdk/pull/8259


More information about the core-libs-dev mailing list