mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 22:59:03 +00:00
FutureAdapter should wrap RuntimeExceptions
RuntimeExceptions thrown from FutureAdapter.adapt() should be wrapped in an ExecutionException, not thrown as is. Issue: SPR-12887
This commit is contained in:
@@ -107,6 +107,12 @@ public abstract class FutureAdapter<T, S> implements Future<T> {
|
||||
this.state = State.FAILURE;
|
||||
throw ex;
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
ExecutionException execEx = new ExecutionException(ex);
|
||||
this.result = execEx;
|
||||
this.state = State.FAILURE;
|
||||
throw execEx;
|
||||
}
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user