Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-390

BeanComparator throws exception for null property values

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.3
    • Fix Version/s: None
    • Component/s: Bean-Collections
    • Labels:
      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              takaitra Matthew Toso

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment