[jdom-interest] getText

Jason Hunter jhunter at collab.net
Wed Oct 4 10:03:26 PDT 2000


Brett McLaughlin wrote:
> 
> typical code ends up being this anyway:
> 
> String text = element.getText();
> if ((text != null) && (!text.equals("")) {
>   System.out.println("Element text is " + text);
> }
> 
> in which case you use both. So you actually save this way.

Well, not quite.  We had defined getText() to return null and never
return "".  So the second test should never have been necessary.  

Still, I remain +1 on returning "".

-jh-



More information about the jdom-interest mailing list