RichFaces
  1. RichFaces
  2. RF-1636

Sorting date-column in scrollableDataTable gives NPE

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Cannot Reproduce Bug
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.5, 3.2.0
    • Component/s: None
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      If you try to sort a column (by clicking the column header) containing entries of the type date, you get a NullPointerException in case one or more date-values are empty in the table.

      Caused by: java.lang.NullPointerException
      at java.util.Date.getMillisOf(Date.java:939)
      at java.util.Date.compareTo(Date.java:959)
      at java.util.Date.compareTo(Date.java:112)
      at org.richfaces.model.internal.WrappedBeanComparator.compare(WrappedBeanComparator.java:42)
      at java.util.Arrays.mergeSort(Arrays.java:1270)
      at java.util.Arrays.sort(Arrays.java:1210)
      at java.util.Collections.sort(Collections.java:159)
      at org.richfaces.model.internal.ComponentSortableDataModel.prepareCollection(ComponentSortableDataModel.java:57)
      at org.richfaces.model.internal.ComponentSortableDataModel.loadData(ComponentSortableDataModel.java:81)
      at org.richfaces.model.DataModelCache.loadData(DataModelCache.java:153)
      at org.richfaces.model.ScrollableTableDataModel.walk(ScrollableTableDataModel.java:115)
      at org.richfaces.model.DataModelCache.walk(DataModelCache.java:183)
      at org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:968)
      ...

        Activity

        Hide
        Jörg von Frantzius
        added a comment -

        Still occurs with richfaces-ui-3.1.3.GA. The WrappedBeanComparator really should be prepared for null values.

        Show
        Jörg von Frantzius
        added a comment - Still occurs with richfaces-ui-3.1.3.GA. The WrappedBeanComparator really should be prepared for null values.
        Hide
        Mike Colburn
        added a comment -

        This still happens in richfaces-ui-3.1.4.GA. The data does not have to be of type date. The exception occurs when you sort a column that has some empty cells (no data).

        Show
        Mike Colburn
        added a comment - This still happens in richfaces-ui-3.1.4.GA. The data does not have to be of type date. The exception occurs when you sort a column that has some empty cells (no data).
        Show
        Ilya Shaikovsky
        added a comment - check please. http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128458#4128458
        Hide
        Maksim Kaszynski
        added a comment -

        If you still experience the problem, please attach sample war, and actual stack trace

        Show
        Maksim Kaszynski
        added a comment - If you still experience the problem, please attach sample war, and actual stack trace
        Hide
        Mikhail Vitenkov
        added a comment -

        No NPE appears.

        Show
        Mikhail Vitenkov
        added a comment - No NPE appears.

          People

          • Assignee:
            Mikhail Vitenkov
            Reporter:
            Alexander Seitz
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: