> From: Travis Stevens [mailto:[EMAIL PROTECTED]
> Subject: printing an object whose toString() method returns null
> 
> Now I know that this is a programming mistake, but it would have been 
> nicer if a more specific error message was thrown.  This can be easily 
> accomplished by adding a check to the print(Object o) method that checks 
> the result of String.valueOf().

So we should increase everyone's path length because one person does something 
completely counter to the Java API intent?

> Unfortunately, the Jsp 2.0 specification does not address 
> this issue.

Nor should it, since this is a Java API issue, not a JSP spec one.

> The print(Object o) is not documented to throw a 
> NullPointerException, only an IOException.

>From the API spec:

"public class RuntimeException extends Exception

"RuntimeException is the superclass of those exceptions that can be thrown during the 
normal operation of the Java Virtual Machine. 

"A method is not required to declare in its throws clause any subclasses of 
RuntimeException that might be thrown during the execution of the method but not 
caught."

NullPointerException is merely the most common of the large set of RuntimeException 
subclasses.

 - Chuck

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to