@SuppressWarnings("unchecked") @Override public E join() { if (result instanceof Throwable) { sneakyThrow((Throwable) result); } return (E) result; }
@Override public Future<V> call() { try { return executor.submit(callable); } catch (Throwable t) { ExceptionUtil.sneakyThrow(t); } return null; }
@Override public Future<V> call() { try { return executor.submit(callable); } catch (Throwable t) { ExceptionUtil.sneakyThrow(t); } return null; }
private Future<V> peel() { // Get the delegating Executor Future (in case of Callable, see. DelegatingCallableTaskDecorator) try { return (Future) original.get(); } catch (InterruptedException e) { currentThread().interrupt(); sneakyThrow(e); } catch (ExecutionException e) { sneakyThrow(e); } return null; }
private Future<V> peel() { // Get the delegating Executor Future (in case of Callable, see. DelegatingCallableTaskDecorator) try { return (Future) original.get(); } catch (InterruptedException e) { currentThread().interrupt(); sneakyThrow(e); } catch (ExecutionException e) { sneakyThrow(e); } return null; }
private void handleProcessorThrowable(Throwable t) { notifyRemoteException(supervisor, t); if (t instanceof Error) { ExceptionUtil.sneakyThrow(t); } }
@Override public V get() throws InterruptedException, ExecutionException { try { return get(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { return ExceptionUtil.sneakyThrow(e); } }
@Override public void awaitUninterruptibly() { try { await(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { // TODO: @mm - what if interrupted? sneakyThrow(e); } }
@Override public void awaitUninterruptibly() { try { await(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { // TODO: @mm - what if interrupted? ExceptionUtil.sneakyThrow(e); } }
@Override public void awaitUninterruptibly() { try { await(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { // TODO: @mm - what if interrupted? ExceptionUtil.sneakyThrow(e); } }
private void checkTimeout() { long timeoutMillis = TimeUnit.SECONDS.toMillis(timeout); if (startTime + timeoutMillis < Clock.currentTimeMillis()) { sneakyThrow(new XAException(XAException.XA_RBTIMEOUT)); } }
private void checkTimeout() { long timeoutMillis = TimeUnit.SECONDS.toMillis(timeout); if (startTime + timeoutMillis < Clock.currentTimeMillis()) { sneakyThrow(new XAException(XAException.XA_RBTIMEOUT)); } }
private static <V> V getResult(Object state) { if (isCancelledState(state)) { return null; } if (!isDoneState(state)) { return null; } if (state instanceof Throwable) { sneakyThrow((Throwable) state); } return (V) state; }
private static <V> V getResult(Object state) { if (isCancelledState(state)) { return null; } if (!isDoneState(state)) { return null; } if (state instanceof Throwable) { sneakyThrow((Throwable) state); } return (V) state; }
private void checkTimeout() { if (startTime + timeoutMillis < Clock.currentTimeMillis()) { ExceptionUtil.sneakyThrow(new XAException(XAException.XA_RBTIMEOUT)); } } }
private void checkTimeout() { if (startTime + timeoutMillis < Clock.currentTimeMillis()) { ExceptionUtil.sneakyThrow(new XAException(XAException.XA_RBTIMEOUT)); } } }
@Override public V get() throws InterruptedException, ExecutionException { try { return this.get0().get(); } catch (ScheduledTaskResult.ExecutionExceptionDecorator ex) { return sneakyThrow(ex.getCause()); } }
@Override public V get() throws InterruptedException, ExecutionException { try { return this.get0().get(); } catch (ScheduledTaskResult.ExecutionExceptionDecorator ex) { return sneakyThrow(ex.getCause()); } }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { checkNotNull(unit, "Unit is null"); try { return this.get0().get(timeout, unit); } catch (ScheduledTaskResult.ExecutionExceptionDecorator ex) { return sneakyThrow(ex.getCause()); } }
@Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { checkNotNull(unit, "Unit is null"); try { return this.get0().get(timeout, unit); } catch (ScheduledTaskResult.ExecutionExceptionDecorator ex) { return sneakyThrow(ex.getCause()); } }