commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] [Commented] (MATH-856) Deprecate "NullArgumentException"
Date Sat, 08 Sep 2012 15:22:07 GMT


Phil Steitz commented on MATH-856:

Probably better to take this discussion back to the mailing list, as we do not have consensus
on what we are going to do.  

I am OK with the conclusion that it is not practical for every class in [math] to advertise
all exceptions raised or propagated by the code.  I just don't want to reduce robustness in
documentation and parameter checking where it exists today.  Just "letting the JVM handle
null references" means unexpected NPEs that can cause problems for applications. Same applies
to array index exceptions and all other kinds of RTE that can be triggered by the code if
parameters are not checked. Checking for carefully documented precondition failures and throwing
IAE per clear documentation and with an informative message *at the point of method invocation*
is much better, IMO[1].  I understand you disagree.  Lets leave things alone for now.

[1] From Eric Raymond's _The Art of Unix Programming_ "...when you must fail, fail noisily
and as soon as possible"
> Deprecate "NullArgumentException"
> ---------------------------------
>                 Key: MATH-856
>                 URL:
>             Project: Commons Math
>          Issue Type: Task
>    Affects Versions: 3.0
>            Reporter: Gilles
>            Priority: Trivial
>             Fix For: 3.1, 4.0
> [Discussions|] on the "dev" ML concluded
that "NullArgumentException" was more of a burden to maintain than it brings benefits.
> It will be deprecated in 3.1 and removed in 4.0.
> Checks for "null" in CM code will either be maintained or be removed.
> Whenever checks for "null" are performed, the exception to be thrown is the standard
"NullPointerException" (instantiated with the no-arg constructor).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message