Files
openide/java/java-impl/resources/inspectionDescriptions/NakedNotify.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

23 lines
797 B
HTML

<html>
<body>
Reports <code>Object.notify()</code> or <code>Object.notifyAll()</code> being called without any detectable state change occurring.
<p>
Normally, <code>Object.notify()</code> and <code>Object.notifyAll()</code> are used to inform other threads that a state change has
occurred. That state change should occur in a synchronized context that contains the <code>Object.notify()</code> or
<code>Object.notifyAll()</code> call, and prior to the call. While not having such a state change isn't necessarily incorrect, it is
certainly worth examining.
</p>
<p><b>Example:</b></p>
<pre><code>
synchronized (this) {
notify();
}
// no state change
synchronized (this) {
notify(); // this notify might be redundant
}
</code></pre>
<!-- tooltip end -->
</body>
</html>