commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: [Math] Usage of "NullPointerException"
Date Thu, 05 Aug 2010 10:34:28 GMT
> >>> A simpler policy would be to not check for "null" and let the JVM do it.
> >>> the JVM will do it anyway, it's a redundant check when the reference is
> >>> null, i.e. most of time (in legitimate usage).
> >> This simpler policy seems fine to me.
> >> However, it is an important change from previous behaviour.
> Sorry, I am not sure I understand what you mean by the "simpler
> policy."  Which one do you mean:
> 0) remove null checks uniformly and just let NPEs propagate everywhere


> 1) remove NPE wrappers, propagating uwrapped NPEs where the code
> wraps and rethrows NPE today.

I don't understand this. I didn't find occurrences where a NPE is wrapped
into something else.

> 2) other?
> I am -1 on 0), since this would result in loss of FFC info available
> in the cases where we rethrow NPE as IAE with an exception message
> indicating which argument was null (like the examples below).

What does FFC mean?
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
we could still do explicit checks for "null" but nevertheless throw the
standard (non-specific and non localized) NPE.

> [...]


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

View raw message