Browse Source

Polishing

pull/671/head
Juergen Hoeller 10 years ago
parent
commit
2956049c30
  1. 4
      spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncResult.java
  2. 12
      spring-core/src/main/java/org/springframework/util/concurrent/ListenableFutureAdapter.java

4
spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncResult.java

@ -84,8 +84,8 @@ public class AsyncResult<V> implements ListenableFuture<V> {
try { try {
successCallback.onSuccess(this.value); successCallback.onSuccess(this.value);
} }
catch (Throwable t) { catch (Throwable ex) {
failureCallback.onFailure(t); failureCallback.onFailure(ex);
} }
} }

12
spring-core/src/main/java/org/springframework/util/concurrent/ListenableFutureAdapter.java

@ -21,9 +21,9 @@ import java.util.concurrent.ExecutionException;
/** /**
* Abstract class that adapts a {@link ListenableFuture} parameterized over S into a * Abstract class that adapts a {@link ListenableFuture} parameterized over S into a
* {@code ListenableFuture} parameterized over T. All methods are delegated to the * {@code ListenableFuture} parameterized over T. All methods are delegated to the
* adaptee, where {@link #get()}, {@link #get(long, java.util.concurrent.TimeUnit)}, and * adaptee, where {@link #get()}, {@link #get(long, java.util.concurrent.TimeUnit)},
* {@link ListenableFutureCallback#onSuccess(Object)} call {@link #adapt(Object)} on the * and {@link ListenableFutureCallback#onSuccess(Object)} call {@link #adapt(Object)}
* adaptee's result. * on the adaptee's result.
* *
* @param <T> the type of this {@code Future} * @param <T> the type of this {@code Future}
* @param <S> the type of the adaptee's {@code Future} * @param <S> the type of the adaptee's {@code Future}
@ -34,7 +34,7 @@ public abstract class ListenableFutureAdapter<T, S> extends FutureAdapter<T, S>
/** /**
* Construct a new {@code ListenableFutureAdapter} with the given adaptee. * Construct a new {@code ListenableFutureAdapter} with the given adaptee.
* @param adaptee the future to adaptee to * @param adaptee the future to adapt to
*/ */
protected ListenableFutureAdapter(ListenableFuture<S> adaptee) { protected ListenableFutureAdapter(ListenableFuture<S> adaptee) {
super(adaptee); super(adaptee);
@ -59,8 +59,8 @@ public abstract class ListenableFutureAdapter<T, S> extends FutureAdapter<T, S>
Throwable cause = ex.getCause(); Throwable cause = ex.getCause();
onFailure(cause != null ? cause : ex); onFailure(cause != null ? cause : ex);
} }
catch (Throwable t) { catch (Throwable ex) {
onFailure(t); onFailure(ex);
} }
} }
@Override @Override

Loading…
Cancel
Save