"John Keiser" <[EMAIL PROTECTED]> writes:

> I agree completely.  The decision is completely out of our hands,
> though; we need to throw exactly the same exceptions as Java 2, so
> that stuff compiled against us will work as expected on Sun, and
> vice versa.

This is not the case.  See section 8.4.4 of the JLS, or write your own
simple test case.  It's perfectly fine to put unchecked exceptions on
the throws clause (and putting it on the throws clause does _not_
cause it to become a checked exception).

> In most cases NullPointerException is not thrown (I am unaware of
> any, but the possibility remains).

For your Double/Float cases, if the String passed in is null, a
NullPointerException results.

> I think that declaring even NullPointerException in the JavaDoc is a
> good idea, because there are some cases where we just ignore the
> argument if it is null.

What?  We should know ahead of time if its possible to throw a
NullPointerException because of an argument.  If it is, we declare
that we throw it, if not, then we don't.

-- 
Paul Fisher * [EMAIL PROTECTED]

Reply via email to