Skip to content

Make SortField immutableΒ #15480

@romseygeek

Description

@romseygeek

Description

Sort objects are shallowly immutable, but their inner SortField implementations are not, which could cause hard-to-track down bugs. We should make SortField immutable as well.

The field, type and reverse fields can be made final with no change in API. Missing values are trickier, as they are currently mutable via a setMissingValue method. My suggestion would be to deprecate this method in 10.4, and add constructors that explicitly take missing values (which could also enhance type safety); and then remove the method in 11.0.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions