mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-08 16:19:48 +00:00
SPR-7840: comparator dealing with nulls
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4156 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+2
-2
@@ -33,9 +33,9 @@ public class StandardTypeComparator implements TypeComparator {
|
||||
public int compare(Object left, Object right) throws SpelEvaluationException {
|
||||
// If one is null, check if the other is
|
||||
if (left == null) {
|
||||
return right == null ? 0 : 1;
|
||||
return right == null ? 0 : -1;
|
||||
} else if (right == null) {
|
||||
return -1; // left cannot be null
|
||||
return 1; // left cannot be null
|
||||
}
|
||||
|
||||
// Basic number comparisons
|
||||
|
||||
Reference in New Issue
Block a user