commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Giannakopoulos <>
Subject Re: [Math - 403] Never propagate a "NullPointerException" resulting from bad usage of the API
Date Thu, 03 Mar 2011 00:09:27 GMT
I believe that the majority of exceptions should be in the same package and
not to under different ones...

> >>because most exceptions are general and thus I don't see the benefit of
> >>scattering the remaining few among several packages.

+1 for the proposal of Gilles

>  6) don't provide any top-level exception for errors occurring in
> >     user-provided code (for solvers, ode, matrix visitors ...) but
> >     ask them in documentation to use their own unchecked exception
> >     that [math] will never see (i.e. remove FunctionEvaluationException,
> >     DerivativeException, MatrixVisitorException)
> +1 for the one of Luc

> I'm not sure for NullPointer/NullArgument. Perhaps our own
> > NullArgumentException with the [lang] exception context principle would
> > be fine. I doubt we should check everything by ourselves (it would be a
> > real performance killer), so whatever we choose there will be untracked
> > NPE. We should check some arguments where it makes sense, which is what
> > we already do at some places.
> +1 for dropping "NullArgumentException" and letting the JVM raise NPE.

+1 to this one

Also i think that we should check for some exceptions that are not covered
by those which have been implemented so far (for example when we have two
numbers 'a' and 'b' and 'a' should always be greater than 'b'...). In this
case we should implement them... And of course, to erase all those
exceptions for which no 'throw' clause exists as Gilles said.

Giannakopoulos Michael

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