Details
-
Bug
-
Resolution: Won't Do
-
Optional
-
None
-
11.0.0.Final
-
None
Description
AsyncInvocationTask.get() on cancelled task in Wildfly 11 throws CancellationException via EjbLogger, but the behavior is not declared in method signature:
public synchronized Object get() throws InterruptedException, ExecutionException { for (;;) switch (status) { case ST_RUNNING: wait(); break; *case ST_CANCELLED: throw EjbLogger.ROOT_LOGGER.taskWasCancelled();* case ST_FAILED: throw new ExecutionException(failed); case ST_DONE: return result; default: throw Assert.impossibleSwitchCase(status); } }
Wildfly 10.01.0 code is different:
public synchronized Object get() throws InterruptedException, ExecutionException { while (!isDone()) { wait(); } if (failed != null) { throw new ExecutionException(failed); } return result; }
It throws InterruptedException instead as declared.