config
config copied to clipboard
ConfigObject is not immutable - can mutate through keySet()
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<String>. This Set cannot be added to, but it supports element removal.