Inspectopedia Help

'wait()' called on 'java.util.concurrent.locks.Condition' object

Reports calls to wait() made on a java.util.concurrent.locks.Condition object. This is probably a programming error, and some variant of the await() method was intended instead.

Example:

void acquire(Condition released) throws InterruptedException { while (acquired) { released.wait(); } }

Good code would look like this:

void acquire(Condition released) throws InterruptedException { while (acquired) { released.await(); } }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023