commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Toso (JIRA)" <>
Subject [jira] Created: (BEANUTILS-390) BeanComparator throws exception for null property values
Date Fri, 11 Mar 2011 16:38:01 GMT
BeanComparator throws exception for null property values

                 Key: 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:

View raw message