mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
23 lines
797 B
HTML
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> |