Browse Source

Fix construction of NullSafeComparator in nullsLow

Previously, both nullsLow(Comparator<T>) and
nullsHigh(Comparator<T>) returned a
NullSafeComparator which treated nulls as being
high. This commit corrects this typo.
pull/1978/merge
Sam Hubbard 6 years ago committed by Juergen Hoeller
parent
commit
80e7819d6f
  1. 2
      spring-core/src/main/java/org/springframework/util/comparator/Comparators.java

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

@ -52,7 +52,7 @@ public abstract class Comparators {
* @see NullSafeComparator#NullSafeComparator(boolean) * @see NullSafeComparator#NullSafeComparator(boolean)
*/ */
public static <T> Comparator<T> nullsLow(Comparator<T> comparator) { public static <T> Comparator<T> nullsLow(Comparator<T> comparator) {
return new NullSafeComparator<>(comparator, false); return new NullSafeComparator<>(comparator, true);
} }
/** /**

Loading…
Cancel
Save