mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
unguarded field access: support sync expressions (IDEA-153399)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import javax.annotation.concurrent.GuardedBy;
|
||||
|
||||
class Example
|
||||
{
|
||||
private final Distribution distribution = new Distribution();
|
||||
|
||||
public void add(long value)
|
||||
{
|
||||
synchronized (distribution) {
|
||||
distribution.total += value;
|
||||
<error descr="Cannot resolve symbol 'total'">total</error> += value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected static class Distribution
|
||||
{
|
||||
@GuardedBy("this")
|
||||
private long total = 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user