Tapestry
  1. Tapestry
  2. TAPESTRY-2182

NullPointerExceptions, due to reading nested properties that do not suppress null values, do not indicate problematic expression for AbstractPropertyOutput derivatives

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.10
    • Fix Version/s: 5.0.11
    • Component/s: Core Components
    • Labels:
      None

      Description

      When supplying a data source to a grid, if any instance in that data source has a null value for any of the rendered properties, an NPE will be thrown. Unfortunately, the error message does not indicate what the problematic property is, so the developer has to use a hold-one-out strategy to debug the problem. Indicating the column with the problem would help considerably. If there were a way to meaningfully identify the row as well, that would be extra nice.

        Activity

        Hide
        Kevin Menard added a comment -

        Digging in a bit more, this only applies to nested properties. Incidentally, it applies to more than just Grid as well. It applies to anything that extends AbstractPropertyOutput. I'll have to check it even makes sense to handle this in a larger sense with the conduit wrapper.

        Note that the NPE isn't the issue of contention. The docs indicate that "?." should be used to suppress null values. The problem is that the current exception doesn't really give any helpful information as to the cause of the NPE.

        Show
        Kevin Menard added a comment - Digging in a bit more, this only applies to nested properties. Incidentally, it applies to more than just Grid as well. It applies to anything that extends AbstractPropertyOutput. I'll have to check it even makes sense to handle this in a larger sense with the conduit wrapper. Note that the NPE isn't the issue of contention. The docs indicate that "?." should be used to suppress null values. The problem is that the current exception doesn't really give any helpful information as to the cause of the NPE.
        Hide
        Kevin Menard added a comment -

        I looked at addressing this property conduit level, but that's way too invasive. The core issue is that the user is at least one level away from the NPE because Grid et al. hide the implementation. For custom components, it really shouldn't be much of an issue because the highlighted template will show the user's problematic code.

        Show
        Kevin Menard added a comment - I looked at addressing this property conduit level, but that's way too invasive. The core issue is that the user is at least one level away from the NPE because Grid et al. hide the implementation. For custom components, it really shouldn't be much of an issue because the highlighted template will show the user's problematic code.
        Hide
        Kevin Menard added a comment -

        Fixed the issue at the AbstractPropertyOutput level so that all subclasses of it may benefit.

        Show
        Kevin Menard added a comment - Fixed the issue at the AbstractPropertyOutput level so that all subclasses of it may benefit.

          People

          • Assignee:
            Kevin Menard
            Reporter:
            Kevin Menard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development