Skip to content

Commit 2a7feba

Browse files
committed
iluwatar#587 SonarQube reports bugs
As recommended in https://sonarcloud.io/organizations/default/rules#rule_key=squid%3AS2274 Used while insteadof if - for waiting upon a condition.
1 parent 68d094a commit 2a7feba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public T getValue() throws ExecutionException {
139139
@Override
140140
public void await() throws InterruptedException {
141141
synchronized (lock) {
142-
if (!isCompleted()) {
142+
while (!isCompleted()) {
143143
lock.wait();
144144
}
145145
}

0 commit comments

Comments
 (0)