RE: Bug report comments requested

"Berin Loritsch" <[email protected]> Fri, 10 Jan 2003 11:26:02 -0500
Newsgroups gmane.comp.jakarta.avalon.apps.devel,gmane.comp.jakarta.avalon.devel
Message-ID <[email protected]>
> From: news [mailto:[email protected]]On Behalf Of Ulrich Mayring
> In our version of Phoenix (pre 4.0) it was not returning null, but the
> empty string.
> 
> As far as I see it, now it is not possible anymore to distinguish
> between "empty element" (returns "") and "element not 
> present" (returns
> null). Many of our applications use these tests.


It is possible if you use "null" as your default value:

String myVal = config.getAttribute("name", null);
if (myVal == null) throw new NullPointerException("@name");