Here you can find the source of exceptionWithCause(T exception, Throwable cause)
static <T extends Throwable> T exceptionWithCause(T exception, Throwable cause)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w. j a va 2 s . com * Throw the exception with the specified cause. * * <p>Needed instead of constructor version to be compatible with JDK 1.5 which is required * until Andriod libraries can update to JDK 1.6 */ static <T extends Throwable> T exceptionWithCause(T exception, Throwable cause) { exception.initCause(cause); return exception; } }