classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Declaring RuntimeExceptions?


From: Tom Tromey
Subject: Re: Declaring RuntimeExceptions?
Date: 11 Sep 2003 13:01:28 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Ingo" == Ingo Prötel <address@hidden> writes:

Ingo> If you do a getExceptionTypes() on java.lang.reflect.Method you will get
Ingo> all declared Throwables. This includes RuntimeExceptions and Errors that
Ingo> are declared to be thrown by a method (also for constructors).

Let me offer a contrarian view.  I think declaring these exceptions is
a bit ugly.  It is unnecessary.  I've always viewed the cases where
Sun has done this as simple mistakes on their part.

Second, I doubt there is any program out there that actually relies on
this.  So while this is a theoretical difference, in practice I think
it will affect nothing.  Plus, we have a good argument that code
relying on this is incorrect anyway.  Sun could easily remove these
declarations in a future version; after all, it affects neither source
nor binary compatibility.

We are already not reflection-compatible at other places.  For
instance, we don't always implement the same overloads that Sun does.

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]