Skip to content

Commit 2bb7164

Browse files
committed
AsyncRestTemplate and FutureAdapter consistently throw ExecutionException
Issue: SPR-13413
1 parent d99717c commit 2bb7164

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -59,27 +59,27 @@ protected FutureAdapter(Future<S> adaptee) {
5959
* Returns the adaptee.
6060
*/
6161
protected Future<S> getAdaptee() {
62-
return adaptee;
62+
return this.adaptee;
6363
}
6464

6565
@Override
6666
public boolean cancel(boolean mayInterruptIfRunning) {
67-
return adaptee.cancel(mayInterruptIfRunning);
67+
return this.adaptee.cancel(mayInterruptIfRunning);
6868
}
6969

7070
@Override
7171
public boolean isCancelled() {
72-
return adaptee.isCancelled();
72+
return this.adaptee.isCancelled();
7373
}
7474

7575
@Override
7676
public boolean isDone() {
77-
return adaptee.isDone();
77+
return this.adaptee.isDone();
7878
}
7979

8080
@Override
8181
public T get() throws InterruptedException, ExecutionException {
82-
return adaptInternal(adaptee.get());
82+
return adaptInternal(this.adaptee.get());
8383
}
8484

8585
@Override
@@ -107,7 +107,7 @@ final T adaptInternal(S adapteeResult) throws ExecutionException {
107107
this.state = State.FAILURE;
108108
throw ex;
109109
}
110-
catch (RuntimeException ex) {
110+
catch (Throwable ex) {
111111
ExecutionException execEx = new ExecutionException(ex);
112112
this.result = execEx;
113113
this.state = State.FAILURE;

spring-web/src/main/java/org/springframework/web/client/AsyncRestTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ protected final T adapt(ClientHttpResponse response) throws ExecutionException {
666666
}
667667
return convertResponse(response);
668668
}
669-
catch (IOException ex) {
669+
catch (Throwable ex) {
670670
throw new ExecutionException(ex);
671671
}
672672
finally {

0 commit comments

Comments
 (0)