Norman Maurer wrote:
Joachim Draeger schrieb:
...
BTW: I have often seen NPE *bugs* in debug messages, that appeared
magically when the costumer has turned on *de*bugging. :-) This could
avoided by putting a try/catch block around...
Joachim
Im against this.. Even if the NPE is in the debug message it should not
catched. IMHO thats a bad practice.. NPE should fixed not "catched" ;-)
bye
Norman
Norman is totally right.
We should notice that the NullPointerException class is on purpose a
subclass of RuntimeException, whose handling is not enforced by the java
compiler just because it is a "coding error" that, by definition, can
not be anticipated and should just be fixed when found. It does not make
sense to anticipate any possible RuntimeException *locally* in any
possible place surrounding everything everywhere by try/catch blocks.
It does make sense instead to have a global try/catch block somewhere to
avoid having a server crash, and this does exist in James (see
http://wiki.apache.org/james/HandlingExceptions).
Vincenzo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]