commons-issues mailing list archives

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

    [ https://issues.apache.org/jira/browse/MATH-856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451346#comment-13451346
] 

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"
http://catb.org/esr/writings/taoup/html/ch01s06.html#id2878538
                
> Deprecate "NullArgumentException"
> ---------------------------------
>
>                 Key: MATH-856
>                 URL: https://issues.apache.org/jira/browse/MATH-856
>             Project: Commons Math
>          Issue Type: Task
>    Affects Versions: 3.0
>            Reporter: Gilles
>            Priority: Trivial
>             Fix For: 3.1, 4.0
>
>
> [Discussions|http://markmail.org/message/cl2e6c4pqbluo63e] 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: http://www.atlassian.com/software/jira

Mime
View raw message