Make SortField immutable
Open
type:task
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
### 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.
Contributor guide
Assessment
This issue has not been assessed yet.