01: package net.jcip;
02:
03: /** class Test.
04: */
05: // @net.jcip.annotations.Immutable // OK, findBugs say length must be final !!
06: @net.jcip.annotations.ThreadSafe
07: public final class Test {
08: @net.jcip.annotations.GuardedBy("this")
09: public int length;
10:
11: /** Constructor. */
12: public Test() {
13: }
14:
15: public synchronized int getLength() {
16: return length;
17: }
18:
19: public void setLength(int a) {
20: this .length = a;
21: }
22:
23: public static void main(String[] args) {
24: new Test();
25: }
26:
27: }
|