Code example for InvocationTargetException

Methods: getMessagegetCause

0
    } catch (InstantiationException ex) {
      throw new OpenGammaRuntimeException(ex.getMessage(), ex);
    } catch (IllegalAccessException ex) {
      throw new OpenGammaRuntimeException(ex.getMessage(), ex);
    } catch (InvocationTargetException ex) {
      if (ex.getCause() instanceof RuntimeException) {
        throw (RuntimeException) ex.getCause();
      } 
      throw new OpenGammaRuntimeException(ex.getMessage(), ex);
    } 
  } 
 
  //------------------------------------------------------------------------- 
  /** 
   * Checks if the class is closeable. 
   * <p> 
   * This invokes the close method if it is present. 
   *  
   * @param type  the type, not null 
   * @return true if closeable