<!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>&nbsp;</blockquote>
I&nbsp;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.)&nbsp;?
<br>It may not be "proper"&nbsp;java to return an empty String rather than
null,
<br>but I&nbsp;prefer functionality and ease of use over rigid rules.
<br>&nbsp;
<pre>--&nbsp;
___________________________________________________
Jerry Lawson&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Virtual Summit, Inc.
Virtual Programmer&nbsp;&nbsp; jerry.lawson@virtualsummit.com</pre>
&nbsp;</html>