mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-14 02:16:06 +00:00
End process logic clause has been corrected.
This commit is contained in:
1 parent
4ca205c03c
commit
85060784a7
1 file changed
+2
-4
+2
-4
@@ -57,12 +57,10 @@ public class ThreadAsyncExecutor implements AsyncExecutor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T endProcess(AsyncResult<T> asyncResult) throws ExecutionException, InterruptedException {
|
public <T> T endProcess(AsyncResult<T> asyncResult) throws ExecutionException, InterruptedException {
|
||||||
if (asyncResult.isCompleted()) {
|
if (!asyncResult.isCompleted()) {
|
||||||
return asyncResult.getValue();
|
|
||||||
} else {
|
|
||||||
asyncResult.await();
|
asyncResult.await();
|
||||||
return asyncResult.getValue();
|
|
||||||
}
|
}
|
||||||
|
return asyncResult.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user