Skip to content

ConfigObject is not immutable - can mutate through keySet() #819

@A248

Description

@A248

Despite the documentation, ConfigObject can be mutated. The key set of a map supports removal operations. This happens because of the following factors.

  1. A library user calls ConfigValueFactory.fromMap.
  2. ConfigImpl#fromAnyRef constructs SimpleConfigObject using new SimpleConfigObject(origin, values) where values is a HashMap.
  3. SimpleConfigObject's keySet() method returns a mutable Set. This Set cannot be added to, but it supports element removal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions