return toRuntimeException(e, null);
return e instanceof RuntimeException ? (RuntimeException) e : new RuntimeException(e);
if (ex instanceof RuntimeException) { return (RuntimeException) ex; } else { return new RuntimeException(ex);
if (e == null) { return new NullPointerException("Problem without an Exception"); return e instanceof RuntimeException ? (RuntimeException) e : new RuntimeException(e);
RuntimeException re = new RuntimeException(e); re.setStackTrace(e.getStackTrace()); e.printStackTrace(System.err); return re;
This method is usually called to convert checked Exceptions into unchecked ones.
if (t == null) return new RuntimeException("This RuntimeException wraps a null cause"); else if (t instanceof Error) return new RuntimeException("This RuntimeException wraps an underlying Error (see cause)", t); else if (t instanceof RuntimeException) return (RuntimeException) t; else if (t instanceof Exception) return new RuntimeException("This RuntimeException wraps an underlying checked Exception (see cause)", ...
return new RuntimeException(t);
return throwable instanceof RuntimeException ? (RuntimeException) throwable : new RuntimeException(throwable);
if (throwable instanceof Error) throw (Error) throwable; return throwable instanceof RuntimeException ? (RuntimeException) throwable : new RuntimeException(throwable);
if (exClass.isAssignableFrom(throwable.getClass())) return (T) throwable; if (throwable instanceof RuntimeException) throw (RuntimeException) throwable; if (throwable instanceof Error) throw (Error) throwable; throw new RuntimeException(throwable);