Exceptions thrown when linking sig-poly methods and indy

Paul Sandoz paul.sandoz at oracle.com
Wed Aug 24 17:04:32 UTC 2016


> On 23 Aug 2016, at 17:39, John Rose <john.r.rose at oracle.com> wrote:
> 
> On Aug 22, 2016, at 5:19 PM, David Holmes <david.holmes at oracle.com> wrote:
>> 
>> "exception" (lower-case 'e') is a general term, all of the objects that can be caught in a catch block are exceptions. If you want to refer to specific types of exceptions then it needs to be clear e.g. Throwable, Exception, Error, etc - actual type names with capitals.
> 
> Yes, that's how the spec. works.  I now think the spec. logic for wrapping BSME was
> written in error, partly because of the confusion between 'e' and 'E' exceptions.
> I.e., it's a design bug to fix in the spec.  We need a tracking bug for this.
> 

Here it is:

  https://bugs.openjdk.java.net/browse/JDK-8164693

So we are talking about this kind of catch and re-throw pattern:

  try {
    x();
  } catch (Throwable t) {
      if (t instanceof Error) {
          // Pass through any Error
          throw (Error) t;
      }
      // Wrap any Throwable that is not a subclass of Error
      throw new LinkageError(t.getMessage(), t);
  }

Paul.


More information about the jdk9-dev mailing list