Exceptions thrown when linking sig-poly methods and indy

John Rose john.r.rose at oracle.com
Mon Aug 22 23:24:38 UTC 2016

On Aug 22, 2016, at 3:58 PM, David Holmes <david.holmes at oracle.com> wrote:
> Another possibility is that "exception" was not intended to mean "any exception instance being a subclass of Throwable", but rather was intended to be Exception - and hence all subclasses of Error would be excluded.

Actually, that's better than what I just posted in reply.  The logic for wrapping should be more like:

        … catch (Exception ex) {
            throw new BootstrapMethodError("call site initialization exception", ex);
        } else {
            // throw any LE, BSME, SOE, OOME, TheadDeath, etc., etc.
            throw ex;

Throwable has two subtypes:  Exception and Error.  There have occasional credible
proposals to add a third subtype (e.g., to manage coroutine or closure exits), and
saying "Exceptions are wrapped" is probably better than saying "non-Errors are
wrapped", because it is more specific with respect to any eventual additions.

— John

More information about the jdk9-dev mailing list