diff --git a/android/guava/src/com/google/common/util/concurrent/CombinedFuture.java b/android/guava/src/com/google/common/util/concurrent/CombinedFuture.java index 7f267789928c..15a1c07d78af 100644 --- a/android/guava/src/com/google/common/util/concurrent/CombinedFuture.java +++ b/android/guava/src/com/google/common/util/concurrent/CombinedFuture.java @@ -89,7 +89,6 @@ protected void interruptTask() { @WeakOuter private abstract class CombinedFutureInterruptibleTask extends InterruptibleTask { private final Executor listenerExecutor; - boolean thrownByExecute = true; CombinedFutureInterruptibleTask(Executor listenerExecutor) { this.listenerExecutor = checkNotNull(listenerExecutor); @@ -104,9 +103,7 @@ final void execute() { try { listenerExecutor.execute(this); } catch (RejectedExecutionException e) { - if (thrownByExecute) { - CombinedFuture.this.setException(e); - } + CombinedFuture.this.setException(e); } } @@ -153,7 +150,6 @@ private final class AsyncCallableInterruptibleTask @Override ListenableFuture runInterruptibly() throws Exception { - thrownByExecute = false; ListenableFuture result = callable.call(); return checkNotNull( result, @@ -184,7 +180,6 @@ private final class CallableInterruptibleTask extends CombinedFutureInterruptibl @Override V runInterruptibly() throws Exception { - thrownByExecute = false; return callable.call(); } 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 9e75b54e6329..9dd36e7fc4f1 100644 --- a/android/guava/src/com/google/common/util/concurrent/MoreExecutors.java +++ b/android/guava/src/com/google/common/util/concurrent/MoreExecutors.java @@ -973,31 +973,12 @@ static Executor rejectionPropagatingExecutor( return delegate; } return new Executor() { - boolean thrownFromDelegate = true; - @Override - public void execute(final Runnable command) { + public void execute(Runnable command) { try { - delegate.execute( - new Runnable() { - @Override - public void run() { - thrownFromDelegate = false; - command.run(); - } - - @Override - public String toString() { - return command.toString(); - } - }); + delegate.execute(command); } catch (RejectedExecutionException e) { - if (thrownFromDelegate) { - // wrap exception? - future.setException(e); - } - // otherwise it must have been thrown from a transitive call and the delegate runnable - // should have handled it. + future.setException(e); } } }; diff --git a/guava/src/com/google/common/util/concurrent/CombinedFuture.java b/guava/src/com/google/common/util/concurrent/CombinedFuture.java index 51b80be23263..b8b0e2c0c32b 100644 --- a/guava/src/com/google/common/util/concurrent/CombinedFuture.java +++ b/guava/src/com/google/common/util/concurrent/CombinedFuture.java @@ -89,7 +89,6 @@ protected void interruptTask() { @WeakOuter private abstract class CombinedFutureInterruptibleTask extends InterruptibleTask { private final Executor listenerExecutor; - boolean thrownByExecute = true; CombinedFutureInterruptibleTask(Executor listenerExecutor) { this.listenerExecutor = checkNotNull(listenerExecutor); @@ -104,9 +103,7 @@ final void execute() { try { listenerExecutor.execute(this); } catch (RejectedExecutionException e) { - if (thrownByExecute) { - CombinedFuture.this.setException(e); - } + CombinedFuture.this.setException(e); } } @@ -153,7 +150,6 @@ private final class AsyncCallableInterruptibleTask @Override ListenableFuture runInterruptibly() throws Exception { - thrownByExecute = false; ListenableFuture result = callable.call(); return checkNotNull( result, @@ -184,7 +180,6 @@ private final class CallableInterruptibleTask extends CombinedFutureInterruptibl @Override V runInterruptibly() throws Exception { - thrownByExecute = false; return callable.call(); } diff --git a/guava/src/com/google/common/util/concurrent/MoreExecutors.java b/guava/src/com/google/common/util/concurrent/MoreExecutors.java index a897aaa7e3aa..8a989fed0c70 100644 --- a/guava/src/com/google/common/util/concurrent/MoreExecutors.java +++ b/guava/src/com/google/common/util/concurrent/MoreExecutors.java @@ -1078,31 +1078,12 @@ static Executor rejectionPropagatingExecutor( return delegate; } return new Executor() { - boolean thrownFromDelegate = true; - @Override - public void execute(final Runnable command) { + public void execute(Runnable command) { try { - delegate.execute( - new Runnable() { - @Override - public void run() { - thrownFromDelegate = false; - command.run(); - } - - @Override - public String toString() { - return command.toString(); - } - }); + delegate.execute(command); } catch (RejectedExecutionException e) { - if (thrownFromDelegate) { - // wrap exception? - future.setException(e); - } - // otherwise it must have been thrown from a transitive call and the delegate runnable - // should have handled it. + future.setException(e); } } };