Skip to content

DefaultMap: Evaluate deprecation in favor of modern Map #335

@nexushoratio

Description

@nexushoratio

The global Map class now (as of 2026) implements two new methods that do the same that that DefaultMap does.

  • .getOrInsert()
  • .getOrInsertComputed()

Rather than being part of the constructor, it is handled on each call to .get().


Decision:


  • Check to see if any uses of DefaultMap() would make migration tricky (e.g., plain .get() too convenient).
  • Check against recent ESR versions of Firefox (at least what is in Debian bookworm) to see if a polyfill is required.
    • Polyfill would be needed.
  • If keeping DefaultMap():
    • Add .getWithArguments() that handles the current .get() enhancement
    • Migrate uses
    • Mark old enhancement as deprecated
    • Remove .get() argument enhancement

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions