[jdom-interest] Important proposal: Element/Document changes - bug

Jason Hunter jhunter at collab.net
Fri Jul 28 09:55:18 PDT 2000

> Element#getTextTrim() should check for null text
> first.  

Done in my CVS tree.  I did an optimization on your code by saving the
getText() return value.

> Otherwise StringTokenizer throws an NPE.  I
> also added the same length==0 check as you have in
> getText().

I intentionally left this out because I thought if there was content but
it was only whitespace, then the trimmed version should be "" and not
null.  It returns null if there's really no content at all.  Maybe it
should be null; I don't care much either way.  Opinions welcome.

> BTW, I'm +1 on this method normalizing internal
> whitespace.



More information about the jdom-interest mailing list