commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] Commented: (MATH-401) Policy concerning "null"
Date Thu, 05 Aug 2010 14:30:18 GMT


Phil Steitz commented on MATH-401:

No, what is relevant is not "type" but argument in context.  I do plan to continue to add
informative exception error messages - however we manage the strings.  Method parameter validation
will result in different kinds of exception error messages, some indicating that required
parameters (mentioned by formal parameter name, not type) expected not to be null are null;
others indicating that arguments are out of range, etc.

> Policy concerning "null"
> ------------------------
>                 Key: MATH-401
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 3.0
> Following the discussion on the "dev" ML, it appears that it would be fine to not check
for {{null}} references within CM. The JVM will do it anyway so that it is redundant and not
necessary most of the time (i.e. when usage is valid). When it happens, the problem is obvious
enough that the standard {{NullPointerException}} fully describes it, without the need for
additional specific and localized detailed messages.
> Hence we could remove all explicit checks for {{null}}. Or when early failure is preferred,
make the check and throw {{NullPointerException}} (without a message argument).
> Since failed checks are currently reported with an {{IllegalArgumentException}}, the
change is not backward-compatible.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message