Multi-catch/final rethrow
    Neal Gafter 
    neal at gafter.com
       
    Thu May  6 10:50:21 PDT 2010
    
    
  
On Thu, May 6, 2010 at 10:18 AM, Paul Benedict <pbenedict at apache.org> wrote:
> Joe,
>
> I was looking at your explanation
> >> However, if an Exception is thrown from the try block it should be
> caught
> >> in the "catch(final Exception e)" clause even if the exception is cast
> to
> >> Throwable since catch clauses work based on the runtime class of the
> >> exceptions being thrown.
>
> The method is declared to only throw checked exception B. According to
> your explanation, the "(Throwable)new Exception()" is caught by "final
> Exception e" handler and re-throws -- but it's not of type B.
>
> Isn't this an error?
>
Paul-
This should be an error.  That's why the correction Joe discussed was made
to the spec.  The original spec allowed this program without error.
Cheers,
Neal
    
    
More information about the coin-dev
mailing list