Best code examples for Java 8 InvocationTargetException class (java.lang.reflect.InvocationTargetException)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InvocationTargetException class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 InvocationTargetException examples from Open Source projects
This code example shows how to use the following methods: getCause
    public T newInstance(Object[] args) throws Throwable {
        constructor.setAccessible(true);
        try { 
            return constructor.newInstance(args);
        } catch (InvocationTargetException e) {
            throw e.getCause();
        } 
    } 
 
    @Override 
    public String toString() {
        return constructor.toString();
    } 
} 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getTargetException
This code example shows how to use the following methods: getCause
        try { 
            methodInvoker.invoke(o, parameters);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e); // a security manager is blocking us, we're hosed
        } catch (InvocationTargetException userException) {
            Throwable cause = userException.getCause() != null
                    ? userException.getCause()
                    : userException;
            errors.withSource(injectionPoint).errorInjectingMethod(cause);
        } 
    } 
} 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getCause
mWebSettings_setDatabaseEnabled.invoke(e);
		   } 
		   catch (InvocationTargetException ite) {
	           /* unpack original exception when possible */ 
	           Throwable cause = ite.getCause();
	           if (cause instanceof IOException) {
	               throw (IOException) cause;
	           } else if (cause instanceof RuntimeException) {
	               throw (RuntimeException) cause;
	           } else if (cause instanceof Error) {
	               throw (Error) cause;
	           } else { 
	               /* unexpected checked exception; wrap and re-throw */ 
	               throw new RuntimeException(ite);
	           } 
	       } catch (IllegalAccessException ie) {
	           System.err.println("unexpected " + ie);
	       }	    
	   }	    
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getTargetException
	protected static Object invokeVfsMethod(Method method, Object target, Object... args) throws IOException {
		try { 
			return method.invoke(target, args);
		} 
		catch (InvocationTargetException ex) {
			Throwable targetEx = ex.getTargetException();
			if (targetEx instanceof IOException) {
				throw (IOException) targetEx;
			} 
			ReflectionUtils.handleInvocationTargetException(ex);
		} 
		catch (Exception ex) {
			ReflectionUtils.handleReflectionException(ex);
		} 
 
		throw new IllegalStateException("Invalid code path reached");
	} 
 
	static boolean exists(Object vfsResource) { 
		try { 
Full Snippet Info
7
CodeRank
Related Java 8 InvocationTargetException Questions & Answers:
See Code Examples for Java 8 InvocationTargetException Methods: