Skip to content

fix: restore defensive copying of DataPart data #1014

Description

@malladinagarjuna2

#633 widened DataPart.data from Map<String, Object> to Object and
dropped the data = Map.copyOf(data) defensive copy, so callers can mutate
the contents after construction. The record still copies metadata via
CollectionCopies two lines above.

Widening the type is correct — the spec allows any JSON value — but the
copy should be applied when the value is a Map or List. Also updates
the Javadoc, which currently says data "supports ... null" while the
constructor calls checkNotNullParam and the sibling constructor says
"not null".

Metadata

Metadata

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