> > [...]
> 
> I'm in favor of just letting the JVM throw NPE.  Since there is no
> message in this case, there is nothing to localize.  Using a class
> to check arguments is too much work, since the (localized) message
> "Something was null" is less than helpful.  And assert will be
> turned off in any reasonably configured production server so makes
> the code less readable and adds very little value.  If the null
> happens because of code in CM (as opposed to user error), then we'll
> get a Jira issue, fix it, and add a unit test.  If it is user error,
> then the stack trace of the NPE will tell the developer what was
> wrong in at least 95% of the cases.

That was my first line of arguments, a long time ago. But there was no
agreement mainly because of the will to retain the possibility of localizing
the message, even for NPE (i.e. one should be able to supply a "Localizable"
argument to the constructor of "NullArgumentException"). A second
counter-argument was that in a certain use-case, no stack trace is
available.


Best,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to