Hi Lillian,
On Mon, 2005-08-15 at 15:45 -0400, Lillian Angel wrote:
> /**
> - * getText
> + * Returns the text contained in this TextComponent. If the
> + * underlying document is null, will give a NullPointerException.
> *
> * @return String
> *
> @@ -215,11 +218,20 @@
> */
> public String getText()
> {
> - return null; // TODO
> + try
> + {
> + return getDocument().getText(0, getColumns());
> + }
> + catch (BadLocationException ble)
> + {
> + return "";
> + }
> }Are you sure you want to return the empty string if there is a BadLocationException thrown from the underlying code? It looks like that might hide problems with the Document (sub) class implementation. Better would be to chain it in a InternalError() and throw that since it seems that BadLocationException should never be thrown when getText() is called like this. Cheers, Mark
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Classpath-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath-patches
