]
David Lloyd resolved WFLY-9721.
-------------------------------
Resolution: Rejected
AsyncInvocationTask.get() throws CancellationException
------------------------------------------------------
Key: WFLY-9721
URL:
https://issues.jboss.org/browse/WFLY-9721
Project: WildFly
Issue Type: Bug
Components: EJB
Affects Versions: 11.0.0.Final
Reporter: Denis Shklyaev
Priority: Optional
AsyncInvocationTask.get() on cancelled task in Wildfly 11 throws CancellationException
via EjbLogger, but the behavior is not declared in method signature:
{code:java}
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);
}
}
{code}
Wildfly 10.01.0 code is different:
{code:java}
public synchronized Object get() throws InterruptedException, ExecutionException {
while (!isDone()) {
wait();
}
if (failed != null) {
throw new ExecutionException(failed);
}
return result;
}
{code}
It throws InterruptedException instead as declared.