<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
Brett McLaughlin wrote:
<p>What's the deal with getText() returning null when it has no value?
<br>That's what the docs say, and I guess that one just slipped by me (I've
<br>been really busy lately ;-) ). In any case, that doesn't seem right
<br>wouldn't it be better to return ""? Is there any functional difference
<br>between "" and null? It seems that returning null could cause
<br>NullPointerExceptions, while "" always insures you can compare Strings.
<p>Thoughts? I'd like to suggest changing to returning the empty String
<br>when there's no value.
I tend to agree that an empty String is a lot easier to deal with
<br>a (potentially)null string. How does this compare with the other getXXX()
<br>methods (getContent(), etc.) ?
<br>It may not be "proper" java to return an empty String rather than
<br>but I prefer functionality and ease of use over rigid rules.
Jerry Lawson Virtual Summit, Inc.
Virtual Programmer firstname.lastname@example.org</pre>