BeanComparator throws exception for null property values
--------------------------------------------------------
Key: BEANUTILS-390
URL: https://issues.apache.org/jira/browse/BEANUTILS-390
Project: Commons BeanUtils
Issue Type: Improvement
Components: Bean-Collections
Affects Versions: 1.8.3
Reporter: Matthew Toso
Priority: Minor
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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira