Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
1.8.3
-
None
-
None
Description
When using a BeanComparator to sort on a bean property that may contain null values, an exception is thrown. By default, the BeanComparator uses a ComparableComparator internally. ComparableComparator in turn throws a NullPointerException when it attempts to compare to a null value. My proposed solution is extending BeanComparator with a new class, NullSafeBeanComparator, that incorporates logic from NullComparator. I have a working example and will attach it.