File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
android/guava/src/com/google/common/util/concurrent
guava/src/com/google/common/util/concurrent Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -592,9 +592,13 @@ private V getDoneValue(Object obj) throws ExecutionException {
592592 // While this seems like it might be too branch-y, simple benchmarking proves it to be
593593 // unmeasurable (comparing done AbstractFutures with immediateFuture)
594594 if (obj instanceof Cancellation ) {
595- throw cancellationExceptionWithCause ("Task was cancelled." , ((Cancellation ) obj ).cause );
595+ Cancellation cancellation = (Cancellation ) obj ;
596+ Throwable cause = cancellation .cause ;
597+ throw cancellationExceptionWithCause ("Task was cancelled." , cause );
596598 } else if (obj instanceof Failure ) {
597- throw new ExecutionException (((Failure ) obj ).exception );
599+ Failure failure = (Failure ) obj ;
600+ Throwable exception = failure .exception ;
601+ throw new ExecutionException (exception );
598602 } else if (obj == NULL ) {
599603 /*
600604 * It's safe to return null because we would only have stored it in the first place if it were
Original file line number Diff line number Diff line change @@ -592,9 +592,13 @@ private V getDoneValue(Object obj) throws ExecutionException {
592592 // While this seems like it might be too branch-y, simple benchmarking proves it to be
593593 // unmeasurable (comparing done AbstractFutures with immediateFuture)
594594 if (obj instanceof Cancellation ) {
595- throw cancellationExceptionWithCause ("Task was cancelled." , ((Cancellation ) obj ).cause );
595+ Cancellation cancellation = (Cancellation ) obj ;
596+ Throwable cause = cancellation .cause ;
597+ throw cancellationExceptionWithCause ("Task was cancelled." , cause );
596598 } else if (obj instanceof Failure ) {
597- throw new ExecutionException (((Failure ) obj ).exception );
599+ Failure failure = (Failure ) obj ;
600+ Throwable exception = failure .exception ;
601+ throw new ExecutionException (exception );
598602 } else if (obj == NULL ) {
599603 /*
600604 * It's safe to return null because we would only have stored it in the first place if it were
You can’t perform that action at this time.
0 commit comments