# | Line 38 | Line 38 | public class AtomicLongFieldUpdaterTest | |
---|---|---|
38 | } | |
39 | ||
40 | public void checkCompareAndSetProtectedSub() { | |
41 | < | AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a; |
42 | < | a = updaterFor("protectedField"); |
43 | < | protectedField = 1; |
41 | > | AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = |
42 | > | AtomicLongFieldUpdater.newUpdater |
43 | > | (AtomicLongFieldUpdaterTest.class, "protectedField"); |
44 | > | this.protectedField = 1; |
45 | assertTrue(a.compareAndSet(this, 1, 2)); | |
46 | assertTrue(a.compareAndSet(this, 2, -4)); | |
47 | assertEquals(-4, a.get(this)); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |