eclipse-collections
eclipse-collections copied to clipboard
Primitive non-mutable/immutable map interfaces should not expose mutable methods
As discovered by @donraab in https://github.com/eclipse/eclipse-collections/issues/740#issuecomment-639645017, there seems to be an error in base interface for the primitive maps.
For example, in IntIntMap, we find this method:
/**
* Returns a set containing all the keys in this map. The set is backed by the
* map, so any modifications to the returned set will affect this map.
* @return a mutable set containing the keys in this map
*/
MutableIntSet keySet();
We would expect that it returns IntSet only, and that the sub-interface take care of overriding with the correct type.