The java.util.concurrent.locks.Condition interface provides an alternative to the Object monitor methods
(wait, notify and notifyAll). Hence, the purpose of implementing said interface is to gain access to its more
nuanced await methods.
Consequently, calling the method Object.wait on a class implementing the Condition interface is contradictory and should
be avoided. Use Condition.await instead.
void doSomething(Condition condition) {
condition.wait(); // Noncompliant, Object.wait is called
...
}
void doSomething(Condition condition) {
condition.await(); // Compliant, Condition.await is called
...
}