commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: svn commit: r1518802 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/ test/java/org/apache/commons/csv/
Date Fri, 30 Aug 2013 12:32:48 GMT
On Fri, Aug 30, 2013 at 8:25 AM, Emmanuel Bourg <ebourg@apache.org> wrote:

>
> >> +        if (parameter == null) {
> >> +            throw new IllegalArgumentException("Parameter '" +
> parameterName + "' must not be null!");
> >> +        }
> >> +    }
> >> +}
>
> Isn't a null value supposed to throw a NPE ?
>

Not always IMO. When I see an NPE I assume something is very wrong and that
it could be a bug in the impl OR a call site, somewhere on the code path.

With an IAE, I know for sure it's a problem in the call site (which could
be a bug of course).

I does not help that the JRE/JDK is inconsistent, so it's hard to find
examples.

Gary


> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message