mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
21 lines
553 B
HTML
21 lines
553 B
HTML
<html>
|
|
<body>
|
|
Reports non-<code>final</code>, non-<code>private</code> fields that are accessed in a synchronized context.
|
|
<p>
|
|
A non-<code>private</code> field cannot be guaranteed to always be accessed in a synchronized manner, and such "partially synchronized"
|
|
access may result in unexpectedly inconsistent data structures.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
class Bar {
|
|
public String field1;
|
|
}
|
|
public Bar myBar;
|
|
|
|
synchronized public void sample() {
|
|
myBar.field1 = "bar";
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
</body>
|
|
</html> |