commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject [Math] Usage of "NullPointerException" (Was: Re: svn commit: r981244 - in /commons/proper/math/trunk/src/main: ...)
Date Wed, 04 Aug 2010 11:48:55 GMT

> > Why not in the new "exception" package?
> > [The aim being to deprecate the old "MathRuntimeException".]
> Sorry for that. I'm still not used to the new package.
> Could you look at the various createXxxException factory methods in and
> replace them by dedicated exceptions in the new package ? Obviously this
> one is used only from one class but the older ones are more heavily used.

I've created "MathUnsupportedOperationException" (not committed yet). I was
going to create "MathNullPointerException" but then looking at the usage in
CM, I noticed that most checks for "null" result in throwing an
"IllegalArgumentException"; exceptions to that rule appear in class
"BigFraction". The usage should be consistent. I think that it is fine to
use "MathIllegalArgumentException" everywhere. In which case I think that
that we shouldn't have a "MathNullPointerException" at all (and never throw
a "NullPointerException" explicitly from CM, so that when it happens, it
will mean that some check is missing somewhere).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message