Skip to content

DiffableUtils.diff should return an Immutable Map when used with a JDK Map #88019

@grcevski

Description

@grcevski

Description

When using the DiffableUtils.diff with a vanilla OpenJDK Map, instead of the legacy ImmutableOpenMap interface, we return a mutable map (generic HashMap), which isn't the expected behaviour of the API:

public static <K, T extends Diffable<T>> MapDiff<K, T, Map<K, T>> diff(

We should wrap the map returned by the diff API in an unmodifiable version.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions