Skip to content

Commit ad94181

Browse files
committed
Merge pull request #10959 from dreis2211:use-compare-for-sorting-of-primitives
* pr/10959: Use Integer::compare in AutoConfigurationSorter
2 parents 3be521e + 93b1ebb commit ad94181

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public List<String> getInPriorityOrder(Collection<String> classNames) {
6161
orderedClassNames.sort((o1, o2) -> {
6262
int i1 = classes.get(o1).getOrder();
6363
int i2 = classes.get(o2).getOrder();
64-
return (i1 < i2) ? -1 : (i1 > i2) ? 1 : 0;
64+
return Integer.compare(i1, i2);
6565
});
6666
// Then respect @AutoConfigureBefore @AutoConfigureAfter
6767
orderedClassNames = sortByAnnotation(classes, orderedClassNames);

0 commit comments

Comments
 (0)