Code review request for checked/unchecked exception clarifications (original) (raw)
Peter Jones pcj at roundroom.net
Fri Jan 8 05:00:04 UTC 2010
- Previous message: Code review request for checked/unchecked exception clarifications
- Next message: Code review request for checked/unchecked exception clarifications
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Joe,
Hi. Another nit: the wordings below seem to imply that "new Error()" and "new RuntimeException()" (i.e. not subclasses) make checked exceptions, but of course they are unchecked too.
Cheers, -- Peter
On Jan 7, 2010, at 10:36 PM, Joe Darcy wrote:
David Holmes - Sun Microsystems wrote:
Hi Joe,
This looks fine to me. One minor consistency nit, sometimes you refer to "subclasses of" and sometimes "subclass of" eg: + *
The class {@code Exception} and any subclasses that are not also
+ * subclasses of {@link RuntimeException} are checked + * exceptions. + * For the purposes of compile-time checking of exceptions, {@code + * Throwable} and any subclass of {@code Throwable} that is not also a + * subclass of either {@link RuntimeException} or {@link Error} are + * regarded as checked exceptions. For consistency you could use the same wording for Exception as you do for Throwable. Hi David. That difference you spotted was intentional in this case. The "subclasses" wording is closer to the wording in JLSv3 section 11, but I thought "subclass" was clearer to state the "RuntimeException or Error" constraint Thanks for the review, -Joe
- Previous message: Code review request for checked/unchecked exception clarifications
- Next message: Code review request for checked/unchecked exception clarifications
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]