vigna / fastutil

fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.
Apache License 2.0
1.74k stars 194 forks source link

Object2ObjectArrayMap not supporting entry setValue #323

Open frajt opened 1 month ago

frajt commented 1 month ago

Hi,

just discovered that the Object2ObjectArrayMap entry set Entry::setValue is not supported. The method is throwing UnsupportedOperationException as the BasicEntry::setValue is not overwritten like for the AVLTree or RBTree maps. Please note the more complex EntrySet::remove operation is suppored, so it is asking to have the setValue supported as well.

Recognized by the Guava Collections tests applied on Fast Array vs Fast Hash object maps. Causing inconsistent behavior for applications where for big maps it works, for small maps covered by ArrayMap, it currently fails (version 8.5.12).

Thanks in advance, Michal

vigna commented 1 month ago

Oh yes that's a very long-standing missing implementations. Basically nobody cared in 20+ years. Worth fixing tho.