30 |
|
a = AtomicIntegerFieldUpdater.newUpdater |
31 |
|
(AtomicIntegerFieldUpdaterTest.class, "y"); |
32 |
|
shouldThrow(); |
33 |
< |
} |
34 |
< |
catch (RuntimeException rt) {} |
33 |
> |
} catch (RuntimeException success) {} |
34 |
|
} |
35 |
|
|
36 |
|
/** |
42 |
|
a = AtomicIntegerFieldUpdater.newUpdater |
43 |
|
(AtomicIntegerFieldUpdaterTest.class, "z"); |
44 |
|
shouldThrow(); |
45 |
< |
} |
47 |
< |
catch (RuntimeException rt) {} |
45 |
> |
} catch (RuntimeException success) {} |
46 |
|
} |
47 |
|
|
48 |
|
/** |
54 |
|
a = AtomicIntegerFieldUpdater.newUpdater |
55 |
|
(AtomicIntegerFieldUpdaterTest.class, "w"); |
56 |
|
shouldThrow(); |
57 |
< |
} |
60 |
< |
catch (RuntimeException rt) {} |
57 |
> |
} catch (RuntimeException success) {} |
58 |
|
} |
59 |
|
|
60 |
|
/** |
73 |
|
assertEquals(2,a.get(this)); |
74 |
|
a.set(this,-3); |
75 |
|
assertEquals(-3,a.get(this)); |
79 |
– |
|
76 |
|
} |
77 |
|
|
78 |
|
/** |
91 |
|
assertEquals(2,a.get(this)); |
92 |
|
a.lazySet(this,-3); |
93 |
|
assertEquals(-3,a.get(this)); |
98 |
– |
|
94 |
|
} |
95 |
|
|
96 |
|
/** |
108 |
|
assertTrue(a.compareAndSet(this,2,-4)); |
109 |
|
assertEquals(-4,a.get(this)); |
110 |
|
assertFalse(a.compareAndSet(this,-5,7)); |
111 |
< |
assertFalse((7 == a.get(this))); |
111 |
> |
assertEquals(-4,a.get(this)); |
112 |
|
assertTrue(a.compareAndSet(this,-4,7)); |
113 |
|
assertEquals(7,a.get(this)); |
114 |
|
} |