mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 06:58:41 +00:00
End process logic clause has been corrected.
This commit is contained in:
+2
-4
@@ -57,12 +57,10 @@ public class ThreadAsyncExecutor implements AsyncExecutor {
|
||||
|
||||
@Override
|
||||
public <T> T endProcess(AsyncResult<T> asyncResult) throws ExecutionException, InterruptedException {
|
||||
if (asyncResult.isCompleted()) {
|
||||
return asyncResult.getValue();
|
||||
} else {
|
||||
if (!asyncResult.isCompleted()) {
|
||||
asyncResult.await();
|
||||
return asyncResult.getValue();
|
||||
}
|
||||
return asyncResult.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user