Re: [Math] Usage of "NullPointerException"

2010-08-07 Thread Gilles Sadowski
> >There may be some cases where it makes sense to propagate NPEs > >directly. I don't see any in the code now, but I would not rule it > >out for the future. I am fine, however, dispensing with > >MathRuntimeException.createNullPointerException (that's what I meant > >by "wrapped NPE." Technical

Re: [Math] Usage of "NullPointerException"

2010-08-06 Thread Bill Barker
-- From: "Phil Steitz" Sent: Friday, August 06, 2010 3:34 AM To: "Commons Developers List" Subject: Re: [Math] Usage of "NullPointerException" Gilles Sadowski wrote: The added value that I see is that an IAE d

Re: [Math] Usage of "NullPointerException"

2010-08-06 Thread Gilles Sadowski
> What I propose (as an alternative the "simple" policy) above is to create > a "NullArgumentException" that inherits from "MathIllegalArgumentException". > This exception will be thrown whenever a null check fails (i.e. "null is an > illegal argument"). To be consistent, we should never throw NPE

Re: [Math] Usage of "NullPointerException"

2010-08-06 Thread Phil Steitz
Gilles Sadowski wrote: The added value that I see is that an IAE designating which argument that cannot be null is in fact null gives more specific information to the caller (or production support person examining logs) than just a propagated NPE. >>> Well, my initial post repor

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Gilles Sadowski
> >> The added value that I see is that an IAE designating which argument > >> that cannot be null is in fact null gives more specific information > >> to the caller (or production support person examining logs) than > >> just a propagated NPE. > > > > Well, my initial post reported the inconsiste

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Luc Maisonobe
Le 05/08/2010 16:26, Phil Steitz a écrit : > Gilles Sadowski wrote: As proposed in https://issues.apache.org/jira/browse/MATH-401 we could still do explicit checks for "null" but nevertheless throw the standard (non-specific and non localized) NPE. >>> The added value tha

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Phil Steitz
Gilles Sadowski wrote: >>> As proposed in >>> https://issues.apache.org/jira/browse/MATH-401 >>> we could still do explicit checks for "null" but nevertheless throw the >>> standard (non-specific and non localized) NPE. >>> >> The added value that I see is that an IAE designating which argument >

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Gilles Sadowski
> > As proposed in > > https://issues.apache.org/jira/browse/MATH-401 > > we could still do explicit checks for "null" but nevertheless throw the > > standard (non-specific and non localized) NPE. > > > The added value that I see is that an IAE designating which argument > that cannot be null is

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Phil Steitz
Gilles Sadowski wrote: >> [...] >> >>> I think that using IAE instead of NPE does not bring any added value. It >>> justs goes against standard usage: throw NPE when a reference is "null" >>> and is not allowed to be so. >>> As proposed in >>> https://issues.apache.org/jira/browse/MATH-401 >>> we

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Gilles Sadowski
> [...] > > > I think that using IAE instead of NPE does not bring any added value. It > > justs goes against standard usage: throw NPE when a reference is "null" > > and is not allowed to be so. > > As proposed in > > https://issues.apache.org/jira/browse/MATH-401 > > we could still do explicit

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Phil Steitz
Gilles Sadowski wrote: > A simpler policy would be to not check for "null" and let the JVM do it. > As > the JVM will do it anyway, it's a redundant check when the reference is > not > null, i.e. most of time (in legitimate usage). This simpler policy seems fine to me. >>

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Gilles Sadowski
> >>> A simpler policy would be to not check for "null" and let the JVM do it. > >>> As > >>> the JVM will do it anyway, it's a redundant check when the reference is > >>> not > >>> null, i.e. most of time (in legitimate usage). > >> This simpler policy seems fine to me. > >> However, it is an im

Re: [Math] Usage of "NullPointerException"

2010-08-05 Thread Phil Steitz
Gilles Sadowski wrote: >>> A simpler policy would be to not check for "null" and let the JVM do it. As >>> the JVM will do it anyway, it's a redundant check when the reference is not >>> null, i.e. most of time (in legitimate usage). >> This simpler policy seems fine to me. >> However, it is an imp

Re: [Math] Usage of "NullPointerException"

2010-08-04 Thread Bill Barker
-- From: "Gilles Sadowski" Sent: Wednesday, August 04, 2010 2:27 PM To: Subject: Re: [Math] Usage of "NullPointerException" > A simpler policy would be to not check for "null" and let the JVM do > it. As

Re: [Math] Usage of "NullPointerException"

2010-08-04 Thread Luc Maisonobe
Le 04/08/2010 23:27, Gilles Sadowski a écrit : >>> A simpler policy would be to not check for "null" and let the JVM do it. As >>> the JVM will do it anyway, it's a redundant check when the reference is not >>> null, i.e. most of time (in legitimate usage). >> >> This simpler policy seems fine to m

Re: [Math] Usage of "NullPointerException"

2010-08-04 Thread Gilles Sadowski
> > A simpler policy would be to not check for "null" and let the JVM do it. As > > the JVM will do it anyway, it's a redundant check when the reference is not > > null, i.e. most of time (in legitimate usage). > > This simpler policy seems fine to me. > However, it is an important change from pre

Re: [Math] Usage of "NullPointerException" (Was: Re: svn commit: r981244 - in /commons/proper/math/trunk/src/main: ...)

2010-08-04 Thread Luc Maisonobe
Le 04/08/2010 15:28, Gilles Sadowski a écrit : 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 >>

Re: [Math] Usage of "NullPointerException" (Was: Re: svn commit: r981244 - in /commons/proper/math/trunk/src/main: ...)

2010-08-04 Thread Gilles Sadowski
> > > 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 th

[Math] Usage of "NullPointerException" (Was: Re: svn commit: r981244 - in /commons/proper/math/trunk/src/main: ...)

2010-08-04 Thread Gilles Sadowski
Hi. > > 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 p