mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
17 lines
598 B
HTML
17 lines
598 B
HTML
<html>
|
|
<body>
|
|
Reports synchronization on a call to <code>getClass()</code>.
|
|
<p>
|
|
If the class containing the synchronization is subclassed, the subclass
|
|
will
|
|
synchronize on a different class object. Usually the call to <code>getClass()</code> can be replaced with a class literal expression, for
|
|
example <code>String.class</code>. An even better solution is synchronizing on a <code>private static final</code> lock object, access to
|
|
which can be completely controlled.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code> synchronized(getClass()) {}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
</body>
|
|
</html>
|