Should HashMap::computeIfAbsent be considered a "structural modification" for an existing key?

Michael Rasmussen Michael.Rasmussen at
Sat Nov 24 14:48:27 UTC 2018

From: Peter Levart <peter.levart at>
> From consistency point of view HashMap might be expected to not modify 
> its internal state when it's obvious that the external view of its state 
> doesn't change. .computeIfAbsent() is violating that expectation. 
> WeakHashMap is violating that expectation too, but it has its own 
> reasons while HashMap doesn't have them...
> I  think this could be fixed.

Would this classify as a bug then, or where or how should this properly be reported?


More information about the core-libs-dev mailing list