Use Comparator.comparingInt where appropriate
This commit is contained in:
@@ -21,6 +21,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* Property editor implementation which parses string and creates array of ranges. Ranges
|
||||
@@ -119,7 +120,7 @@ public class RangeArrayPropertyEditor extends PropertyEditorSupport {
|
||||
}
|
||||
|
||||
// sort array of Ranges
|
||||
Arrays.sort(c, (r1, r2) -> ranges[r1].getMin() - ranges[r2].getMin());
|
||||
Arrays.sort(c, Comparator.comparingInt(r -> ranges[r].getMin()));
|
||||
|
||||
// set max values for all unbound ranges (except last range)
|
||||
for (int i = 0; i < c.length - 1; i++) {
|
||||
|
||||
Reference in New Issue
Block a user