mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
27 lines
1.0 KiB
HTML
27 lines
1.0 KiB
HTML
<html>
|
|
<body>
|
|
Reports <code>@GuardedBy</code> annotations on <code>static</code> fields or methods in which the guard is either a non-static field or
|
|
<code>this</code>.
|
|
<p>Guarding a static element with a non-static element may result in
|
|
excessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts.</p>
|
|
<p>Example:</p>
|
|
<pre><code>
|
|
private ReadWriteLock lock = new ReentrantReadWriteLock();
|
|
|
|
@GuardedBy("lock")
|
|
public static void bar() {
|
|
// ...
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>Supported <code>@GuardedBy</code> annotations are:</p>
|
|
<ul>
|
|
<li><code>net.jcip.annotations.GuardedBy</code></li>
|
|
<li><code>javax.annotation.concurrent.GuardedBy</code></li>
|
|
<li><code>org.apache.http.annotation.GuardedBy</code></li>
|
|
<li><code>com.android.annotations.concurrency.GuardedBy</code></li>
|
|
<li><code>androidx.annotation.GuardedBy</code></li>
|
|
<li><code>com.google.errorprone.annotations.concurrent.GuardedBy</code></li>
|
|
</ul>
|
|
</body>
|
|
</html> |