Code review request for checked/unchecked exception clarifications (original) (raw)
Peter Jones pcj at roundroom.net
Fri Jan 8 05:44:08 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 ]
Hi David,
On Jan 8, 2010, at 12:16 AM, David Holmes - Sun Microsystems wrote:
Peter Jones said the following on 01/08/10 15:00:
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. What wording do you think implies this? These are quite clear: + * That is, {@code Error} and its subclasses are regarded as unchecked + * exceptions for the purposes of compile-time checking of exceptions. + *
{@code RuntimeException} and its subclasses are unchecked + * exceptions.
Yes, those seem fine-- I was referring to the excerpts that you had quoted earlier, from the Exception and Throwable docs:
+ *
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.
In JLS usage I don't think that subclass is a reflexive relation (like subtype is). Compare the section 11.2 wording, "RuntimeException and its subclasses", etc.:
http://java.sun.com/docs/books/jls/third_edition/html/exceptions.html#44121
Cheers, -- Peter
- 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 ]