Marc Portier wrote:
> yeah, but this is something that never needs to be catched it really is
> a programming error, so I find the test for null unesessary and the
> possible resulting NPE as more then RTE enough to commincate the coding
> error.
The problem with the NPE is that you'd need to look at the stacktrace to
find what the exception is about, as you get no meaningful message, and
the exception might be thrown when you try to dereference the null
pointer, which could be far from where getId() is called. What I propose
is to throw a RTE when the widget is built. Fail early, if you can.
Admittedly, this is just a convenience for the developer.
Ugo
|