Checked exceptions represent conditions that are unusual but can reasonable 
be expected to occur, Eddie, and if they do occur to be dealt with in some 
way, such as an IOException reading a file.  The idea is to take care of 
these as early as possible, for obvious architectural reasons, and to make 
sure that they are propagated all the way to main(String []) if not 
caught.  Checked exceptions are NEVER unexpected.  They are purposefully 
ignored or taken care of by the coder.  They also are of the type that can 
reasonably be taken care of at runtime.

Unchecked exceptions, on the other hand, normally cannot be fixed at 
runtime.  They normal flow from errors in program logic, that are 
unknown.   If they were known, they would have been fixed, hopefully.  A 
good example is the IndexOutOfBoundException which results from program 
logic erroneously computing the number of elements in an array as being 
smaller than it is.  Given we can and do make errors of logic writing any 
statement, it would be unwise and "totally impracticable" (Arnold, Gosling, 
Holmes) to catch all such errors.

So, you need to look at the context of the code to see if that was a 
reasonable use of a runtime exception.  Here, all they are doing is to 
provide "[t]he base class of all runtime exceptions which can contain other 
exceptions," so, the NestableRuntimeException is internally dropped into a 
NestableDelegate, which you can then access from the NestableRuntimeException.

Micael

At 08:01 PM 10/8/2002 -0500, you wrote:
>Martin Cooper wrote:
>
>>Well, everything extends Object, Eddie! ;-)
>Not directly, we hope :-)
>
>>(Sorry, I couldn't resist that.)
>Yea, I'm glad someone had a good laugh out of it ;-)  Obviously that 
>little heirarchy up there shouldn't be taken entirely literally ...
>
>>The JavaDocs on the web site have the correct scoop:
>>
>>http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/exception
>>/NestableRuntimeException.html
>>
>>and this is from the JavaDocs for RuntimeException:
>>
>>"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."
>I skipped that and went to RuntimeException - the root of that leg. Same 
>info.  Obviously I didn't get smart enough to look there til after my post.
>
>So these guys are like "compiler warnings" at runtime?  ... I never liked 
>warnings.  I'm one of the anal idiots that always set compiles to break on 
>them unless there was something beyond my control I *had* to "live 
>with".  They're more than "suggestions" dad-gummit! <emote:slapKnee/> *ouch*
>
>I prefer things that make you catch them :-/
>
>>--
>>Martin Cooper
>--
>Eddie Bush
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>



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

Reply via email to