Browse Source

Replace with 'Integer.compare()'

See gh-23071
pull/23073/head
Issam El-atif 6 years ago committed by Stephane Nicoll
parent
commit
7ce3792672
  1. 2
      spring-core/src/main/java/org/springframework/util/comparator/InstanceComparator.java

2
spring-core/src/main/java/org/springframework/util/comparator/InstanceComparator.java

@ -56,7 +56,7 @@ public class InstanceComparator<T> implements Comparator<T> {
public int compare(T o1, T o2) { public int compare(T o1, T o2) {
int i1 = getOrder(o1); int i1 = getOrder(o1);
int i2 = getOrder(o2); int i2 = getOrder(o2);
return (i1 < i2 ? -1 : (i1 == i2 ? 0 : 1)); return (Integer.compare(i1, i2));
} }
private int getOrder(@Nullable T object) { private int getOrder(@Nullable T object) {

Loading…
Cancel
Save