Issue 376: unchecked cast

This commit is contained in:
Adrian Cole 2010-10-26 21:02:33 -07:00
parent b306573021
commit f9a233274f
1 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,9 @@ public class ExceptionParsingListenableFuture<T> implements ListenableFuture<T>
}
private T attemptConvert(Exception e) {
return function.apply(e instanceof ExecutionException ? (Exception) e.getCause() : e);
if (e instanceof ExecutionException && e.getCause() instanceof Exception)
return function.apply((Exception) e.getCause());
return function.apply(e);
}
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {