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

27 lines
787 B
HTML

<html>
<body>
Reports access to non-constant static fields that are
locked on either <code>this</code> or an instance field of <code>this</code>.
<p>
Locking a static field on instance data does not prevent the field from being
modified by other instances, and thus may result in unexpected race conditions.
</p>
<p><b>Example:</b></p>
<pre><code>
static String test;
public void foo() {
synchronized (this) {
System.out.println(test); // warning
}
}
</code></pre>
<p>
There is a quick-fix that allows ignoring static fields of specific types.
You can manage those ignored types in the inspection options.
</p>
<!-- tooltip end -->
<p>
Use the inspection options to specify which classes used for static fields should be ignored.
<p>
</body>
</html>