[jdom-interest] XMLOutputter & null pointer exception.

Simon Harris Haruki_Zaemon at hotmail.com
Thu Aug 17 22:10:57 PDT 2000


If it is decided that JDOM no longer return nulls, then setText(null) would
be an error would it not?

Just my 2 cents worth,

Simon.

----- Original Message -----
From: "Jason Hunter" <jhunter at collab.net>
To: "John Interrante" <jinterra at nycap.rr.com>
Cc: <jdom-interest at jdom.org>
Sent: Friday, August 18, 2000 2:11 PM
Subject: Re: [jdom-interest] XMLOutputter & null pointer exception.


> > Therefore, I want to throw my two cents into this discussion too.
> > Like everybody else, I'd prefer getText to return "" for each of these
> > cases,
>
> Cool, I tend to be in agreement too.
>
> My one issue (not real big) with this is that for the foo element:
>
> <foo><bar></bar></foo>
>
> The getMixedContent() List of content will include solely a "bar"
> element, no empty string elements.  Somehow that doesn't feel right.
> But neither does returning null.  :-)
>
> > setText(null)
> >
> > This is problematic for another reason besides requiring support for
> > the xsl:null="true" attribute.  If you read the Javadoc for the Java 2
> > List container class, you'll find out that it says List doesn't define
> > the semantics of what happens if you add a null object to a List.
> > Some List implementations accept it, some don't.
>
> I don't see that as an issue.  We wouldn't be adding a null to any list
> in response to that call.  We'd just be doing content.clear() on the
> list, because setText() replaces all content.  (If you want to add a
> string you say addContent("whatever").)
>
> -jh-
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>



More information about the jdom-interest mailing list