Glen,
If addFieldDesc was just an internal interface, I'd be happy if it resulted
in a NPE when invoked with a null field, but I think that should be the
result of attempting to dereference the null field.
However, addFieldDesc is part of a published Axis interface and the NPE is
thrown after explicitly checking for a null parameter. I.e. robust checking
of the input parameter is desirable and is being performed. Throwing
IllegalArgumentException would be a very satisfactory fix.
On the assumption that I've taken enough of your valuable time with this
relative triviality, I committed the fix (including the TODO entry) and
closed the bug.
Glyn
Glen Daniels
<gdaniels@macrome To: "Axis-Dev (E-mail)"
<[EMAIL PROTECTED]>
dia.com> cc:
Subject: Bug 9987 - NPE
29/06/02 21:44
Please respond to
axis-dev
So we have:
public void addFieldDesc(FieldDesc field)
and want to do something appropriate when field == null. Don't many
standard Java classes (i.e. Hashtable.get()) just throw RuntimeExceptions
(i.e. NPE or IllegalArgumentException) in cases like this, without
explicitly declaring the exceptions? If so, what we were doing (throwing
NPE) might be OK... what's the right thing to do here? Glyn, you raised
the issue - got thoughts?
--Glen