From 80e7819d6f253c3c51013f717f1dbdbe3ea23cbc Mon Sep 17 00:00:00 2001 From: Sam Hubbard Date: Fri, 5 Oct 2018 12:09:47 +0100 Subject: [PATCH] Fix construction of NullSafeComparator in nullsLow Previously, both nullsLow(Comparator) and nullsHigh(Comparator) returned a NullSafeComparator which treated nulls as being high. This commit corrects this typo. --- .../java/org/springframework/util/comparator/Comparators.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/util/comparator/Comparators.java b/spring-core/src/main/java/org/springframework/util/comparator/Comparators.java index 3429f0685e..70c1faa788 100644 --- a/spring-core/src/main/java/org/springframework/util/comparator/Comparators.java +++ b/spring-core/src/main/java/org/springframework/util/comparator/Comparators.java @@ -52,7 +52,7 @@ public abstract class Comparators { * @see NullSafeComparator#NullSafeComparator(boolean) */ public static Comparator nullsLow(Comparator comparator) { - return new NullSafeComparator<>(comparator, false); + return new NullSafeComparator<>(comparator, true); } /**