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.
Description
Sortobjects are shallowly immutable, but their innerSortFieldimplementations are not, which could cause hard-to-track down bugs. We should makeSortFieldimmutable as well.The
field,typeandreversefields can be made final with no change in API. Missing values are trickier, as they are currently mutable via asetMissingValuemethod. 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.