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

31 lines
857 B
HTML

<html>
<body>
Reports non-final fields that are accessed in both <code>synchronized</code> and
non-<code>synchronized</code> contexts.
<code>volatile</code> fields as well as accesses in constructors and initializers are ignored by this inspection.
<p>
Such "partially synchronized" access is often the result of a coding oversight
and may lead to unexpectedly inconsistent data structures.
</p>
<p><b>Example:</b></p>
<pre><code>
public class Program {
Console console; // warning: Field 'console' is accessed in both synchronized and unsynchronized contexts
public synchronized void execute() {
console.print("running");
}
public void check() {
console.check();
}
}
</code>
</pre>
<!-- tooltip end -->
<p>
Use the option to specify if simple getters and setters are counted as accesses too.
<p>
</body>
</html>