Despite the documentation, ConfigObject can be mutated. The key set of a map supports removal operations. This happens because of the following factors.
- A library user calls ConfigValueFactory.fromMap.
- ConfigImpl#fromAnyRef constructs SimpleConfigObject using
new SimpleConfigObject(origin, values)
where values is a HashMap.
- SimpleConfigObject's
keySet()
method returns a mutable Set. This Set cannot be added to, but it supports element removal.