> >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
--
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
> 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
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
> >> 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
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
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
>
> > 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
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
> [...]
>
> > 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
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.
>>
> >>> 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
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
--
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
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
> > 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
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
>>
> > > 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
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
19 matches
Mail list logo