diff options
Diffstat (limited to 'android/guava/src/com/google/common/util/concurrent/MoreExecutors.java')
-rw-r--r-- | android/guava/src/com/google/common/util/concurrent/MoreExecutors.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/android/guava/src/com/google/common/util/concurrent/MoreExecutors.java b/android/guava/src/com/google/common/util/concurrent/MoreExecutors.java index dba374014..cbf051e72 100644 --- a/android/guava/src/com/google/common/util/concurrent/MoreExecutors.java +++ b/android/guava/src/com/google/common/util/concurrent/MoreExecutors.java @@ -678,7 +678,8 @@ public final class MoreExecutors { public void run() { try { delegate.run(); - } catch (RuntimeException | Error t) { + } catch (Throwable t) { + // Any Exception is either a RuntimeException or sneaky checked exception. setException(t); throw t; } @@ -706,7 +707,10 @@ public final class MoreExecutors { * An implementation of {@link ExecutorService#invokeAny} for {@link ListeningExecutorService} * implementations. */ - @SuppressWarnings("GoodTime") // should accept a java.time.Duration + @SuppressWarnings({ + "GoodTime", // should accept a java.time.Duration + "CatchingUnchecked", // sneaky checked exception + }) @J2ktIncompatible @GwtIncompatible @ParametricNullness @@ -769,7 +773,9 @@ public final class MoreExecutors { return f.get(); } catch (ExecutionException eex) { ee = eex; - } catch (RuntimeException rex) { + } catch (InterruptedException iex) { + throw iex; + } catch (Exception rex) { // sneaky checked exception ee = new ExecutionException(rex); } } |