Skip to content

Commit d0be13e

Browse files
committed
Use Comparator.comparingInt where appropriate
1 parent 73114a7 commit d0be13e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/RangeArrayPropertyEditor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import java.beans.PropertyEditorSupport;
2323
import java.util.Arrays;
24+
import java.util.Comparator;
2425

2526
/**
2627
* Property editor implementation which parses string and creates array of ranges. Ranges
@@ -119,7 +120,7 @@ private void setMaxValues(final Range[] ranges) {
119120
}
120121

121122
// sort array of Ranges
122-
Arrays.sort(c, (r1, r2) -> ranges[r1].getMin() - ranges[r2].getMin());
123+
Arrays.sort(c, Comparator.comparingInt(r -> ranges[r].getMin()));
123124

124125
// set max values for all unbound ranges (except last range)
125126
for (int i = 0; i < c.length - 1; i++) {

0 commit comments

Comments
 (0)