Why is this never throwing an AssertionError even after running it for so long?
问题 Here is the original code //@author Brian Goetz and Tim Peierls @ThreadSafe public class SafePoint { @GuardedBy("this") private int x, y; private SafePoint(int[] a) { this(a[0], a[1]); } public SafePoint(SafePoint p) { this(p.get()); } public SafePoint(int x, int y) { this.set(x, y); } public synchronized int[] get() { return new int[]{x, y}; } public synchronized void set(int x, int y) { this.x = x; this.y = y; } } Here it is fine that the private int x,y are not final because the set method