[
https://issues.apache.org/jira/browse/BEANUTILS-390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matthew Toso updated BEANUTILS-390:
-----------------------------------
Attachment: NullSafeBeanComparator.java
This is a working example of the NullSafeBeanComparator.
> 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
> Attachments: NullSafeBeanComparator.java
>
>
> 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