<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Brett McLaughlin wrote:
<blockquote TYPE=CITE>Folks-
<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.
<br> </blockquote>
I tend to agree that an empty String is a lot easier to deal with
than
<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
null,
<br>but I prefer functionality and ease of use over rigid rules.
<br>
<pre>--
___________________________________________________
Jerry Lawson Virtual Summit, Inc.
Virtual Programmer jerry.lawson@virtualsummit.com</pre>
</html>