scalastatic-analysisopal-framework

OPAL-Framework: Get thrown exceptions of a method


In the OPAL-Framework, is how can I get all thrown exceptions from a method or its descriptor? I could not find any method returning them.

I am only interested in those exceptions, which are listed in the throws-declaration of the method.


Solution

  • The Method object provides the method exceptionTable which return an Option of the type ExceptionTable. If the table is not empty, it contains the list of declared exceptions.