blob: 3ca9b3c3f37bcc97e672488bbdb52c246f1416ae [file]
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;
}
}