/** * @deprecated See {@link #launderedException(Class, String, Throwable)}. */ @Deprecated public static RuntimeException launderedException( Throwable exception ) { return launderedException( RuntimeException.class, UNEXPECTED_MESSAGE, exception ); }
/** * @deprecated See {@link #launderedException(Class, String, Throwable)}. */ @Deprecated public static <T extends Throwable> T launderedException( Class<T> type, Throwable exception ) { return launderedException( type, UNEXPECTED_MESSAGE, exception ); }
/** * @deprecated See {@link #launderedException(Class, String, Throwable)}. */ @Deprecated public static RuntimeException launderedException( String messageForUnexpected, Throwable exception ) { return launderedException( RuntimeException.class, messageForUnexpected, exception ); }
return launderedException( type, messageForUnexpected, ( (InvocationTargetException) exception ).getTargetException() );
/** * @deprecated See {@link #launderedException(Class, String, Throwable)}. */ @Deprecated public static RuntimeException launderedException( Throwable exception ) { return launderedException( RuntimeException.class, UNEXPECTED_MESSAGE, exception ); }
/** * @deprecated See {@link #launderedException(Class, String, Throwable)}. */ @Deprecated public static RuntimeException launderedException( String messageForUnexpected, Throwable exception ) { return launderedException( RuntimeException.class, messageForUnexpected, exception ); }
/** * @deprecated See {@link #launderedException(Class, String, Throwable)}. */ @Deprecated public static <T extends Throwable> T launderedException( Class<T> type, Throwable exception ) { return launderedException( type, UNEXPECTED_MESSAGE, exception ); }
private static void finishRunWithConcurrency( CompletionService completionService, Throwable error) { // cancel all regardless of done flag because we could have aborted // from the termination flag completionService.cancelAll(); if (error != null) { throw Exceptions.launderedException(error); } }
private static void finishRunWithConcurrency( CompletionService completionService, Throwable error) { // cancel all regardless of done flag because we could have aborted // from the termination flag completionService.cancelAll(); if (error != null) { throw Exceptions.launderedException(error); } }
return launderedException( type, messageForUnexpected, ( (InvocationTargetException) exception ).getTargetException() );
public static void awaitTerminations(Queue<Future<?>> futures) { boolean done = false; Throwable error = null; try { while (!futures.isEmpty()) { try { futures.poll().get(); } catch (ExecutionException ee) { error = Exceptions.chain(error, ee.getCause()); } catch (CancellationException ignore) { } } done = true; } catch (InterruptedException e) { error = Exceptions.chain(e, error); } finally { if (!done) { for (final Future<?> future : futures) { future.cancel(true); } } } if (error != null) { throw Exceptions.launderedException(error); } }
public static void awaitTerminations(Queue<Future<?>> futures) { boolean done = false; Throwable error = null; try { while (!futures.isEmpty()) { try { futures.poll().get(); } catch (ExecutionException ee) { error = Exceptions.chain(error, ee.getCause()); } catch (CancellationException ignore) { } } done = true; } catch (InterruptedException e) { error = Exceptions.chain(e, error); } finally { if (!done) { for (final Future<?> future : futures) { future.cancel(true); } } } if (error != null) { throw Exceptions.launderedException(error); } }
public static void awaitTermination(Collection<Future<?>> futures) { boolean done = false; Throwable error = null; try { for (Future<?> future : futures) { try { future.get(); } catch (ExecutionException ee) { final Throwable cause = ee.getCause(); if (error != cause) { error = Exceptions.chain(error, cause); } } catch (CancellationException ignore) { } } done = true; } catch (InterruptedException e) { error = Exceptions.chain(e, error); } finally { if (!done) { for (final Future<?> future : futures) { future.cancel(true); } } } if (error != null) { throw Exceptions.launderedException(error); } }
public static void awaitTermination(Collection<Future<?>> futures) { boolean done = false; Throwable error = null; try { for (Future<?> future : futures) { try { future.get(); } catch (ExecutionException ee) { final Throwable cause = ee.getCause(); if (error != cause) { error = Exceptions.chain(error, cause); } } catch (CancellationException ignore) { } } done = true; } catch (InterruptedException e) { error = Exceptions.chain(e, error); } finally { if (!done) { for (final Future<?> future : futures) { future.cancel(true); } } } if (error != null) { throw Exceptions.launderedException(error); } }
return (GraphFactory) constructor.invoke(api, setup); } catch (Throwable throwable) { throw Exceptions.launderedException( throwable.getMessage(), throwable);
throw Exceptions.launderedException(error);
return (GraphFactory) constructor.invoke(api, setup); } catch (Throwable throwable) { throw Exceptions.launderedException( throwable.getMessage(), throwable);
throw Exceptions.launderedException(error);