Code example for InvocationTargetException

Methods: getTargetException

0
        try { 
            m.invoke(this, new Object[] { arg });
        } catch (IllegalAccessException e) {
            throw new BuildException(e);
        } catch (InvocationTargetException e) {
            throw new BuildException(e);
        } 
 
        try { 
            m.invoke(this, new Object[] { badArg });
            fail("Should have raised an assertion exception");
        } catch (IllegalAccessException e) {
            throw new BuildException(e);
        } catch (InvocationTargetException e) {
            Throwable t = e.getTargetException();
            assertTrue(t instanceof junit.framework.AssertionFailedError);
        } 
    } 
 
    public List add(List l) {
        // INVALID extension point