Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-1636

Sorting date-column in scrollableDataTable gives NPE

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce Bug
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.5, 3.2.0
    • Component/s: None
    • Labels:
      None

      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)
      ...

        Gliffy Diagrams

          Activity

          Hide
          joergvf 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
          joergvf 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
          mikecolburn 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
          mikecolburn 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 Ilya Shaikovsky added a comment - check please. http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128458#4128458
          Hide
          maksimkaszynski Maksim Kaszynski added a comment -

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

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

          No NPE appears.

          Show
          mvitenkov Mikhail Vitenkov added a comment - No NPE appears.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development