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