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

Details

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.

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.

Kevin Menard
added a comment - 20/Feb/08 22:38 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.

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.

Kevin Menard
added a comment - 20/Feb/08 21:50 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.