/** * Get the error. */ public Error getError() { return (Error)getCause(); } }
WAITING_THREADS.get(thread).setExceptionIfUndone(new ErrorException(new ThreadDeath())); WAITING_THREADS.get(thread).setExceptionIfUndone(new ErrorException(new ThreadDeath()));
/** * Convert a throwable to an unchecked exception (i.e. error or runtime exception). * Also unpacks InvocationTargeteException and ErrorException. * @param t The throwable. * @return Dummy return value as exception will be thrown inside. Use as <code>throw SUtil.throwUnchecked(t);</code> to avoid compilation errors. */ public static RuntimeException throwUnchecked(Throwable t) throws Error, RuntimeException { if(t instanceof InvocationTargetException) { throw throwUnchecked(((InvocationTargetException)t).getTargetException()); } else if(t instanceof ErrorException) { throw throwUnchecked(((ErrorException)t).getError()); } else if(t instanceof Error) { throw (Error)t; } else if(t instanceof RuntimeException) { throw (RuntimeException)t; } else { throw new RuntimeException(t); } }
if(t instanceof Error) fut.setException(new ErrorException((Error)t));
throw ((ErrorException)exception).getError();
ret.setExceptionIfUndone(e instanceof Exception ? (Exception)e : new ErrorException((Error)e));