Skip to content

Commit 8506078

Browse files
committed
End process logic clause has been corrected.
1 parent 4ca205c commit 8506078

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

async-method-invocation/src/main/java/com/iluwatar/async/method/invocation/ThreadAsyncExecutor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ public <T> AsyncResult<T> startProcess(Callable<T> task, AsyncCallback<T> callba
5757

5858
@Override
5959
public <T> T endProcess(AsyncResult<T> asyncResult) throws ExecutionException, InterruptedException {
60-
if (asyncResult.isCompleted()) {
61-
return asyncResult.getValue();
62-
} else {
60+
if (!asyncResult.isCompleted()) {
6361
asyncResult.await();
64-
return asyncResult.getValue();
6562
}
63+
return asyncResult.getValue();
6664
}
6765

6866
/**

0 commit comments

Comments
 (0)