if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (!strongRefsUpdater.weakCompareAndSet(this, first, first.next)) {
if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (!strongRefsUpdater.weakCompareAndSet( this, first, first.next )) {
if (current == null || duration < current.getDuration()) { final DurationWithTime newObj = new DurationWithTime(duration, System.currentTimeMillis()); while (!SHORTEST_UPDATER.weakCompareAndSet(this, current, newObj)) { current = shortest; if (current != null && duration >= current.getDuration()) { if (current == null || duration > current.getDuration()) { final DurationWithTime newObj = new DurationWithTime(duration, System.currentTimeMillis()); while (!LONGEST_UPDATER.weakCompareAndSet(this, current, newObj)) { current = longest; if (current != null && duration <= current.getDuration()) {
if (current == null || duration < current.getDuration()) { final DurationWithTime newObj = new DurationWithTime(duration, System.currentTimeMillis()); while (!SHORTEST_UPDATER.weakCompareAndSet(this, current, newObj)) { current = shortest; if (current != null && duration >= current.getDuration()) { if (current == null || duration > current.getDuration()) { final DurationWithTime newObj = new DurationWithTime(duration, System.currentTimeMillis()); while (!LONGEST_UPDATER.weakCompareAndSet(this, current, newObj)) { current = longest; if (current != null && duration <= current.getDuration()) {
@Test public void testStringField() { if (verifyNoPropertyViolation(JPF_ARGS)) { AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, String> upd = AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdaterTest.class, String.class, "str"); String s1 = "one"; String s2 = "two"; str = s1; System.out.println(str); assert upd.compareAndSet(this, s1, s2); System.out.println(str); assert str == s2; assert !upd.compareAndSet(this, s1, "nogo"); assert str == s2; assert str == upd.get(this); assert s2 == upd.getAndSet(this, s1); assert str == s1; upd.set(this, s2); assert str == s2; upd.lazySet(this, s1); assert str == s1; assert upd.weakCompareAndSet(this, s1, s2); assert str == s2; assert !upd.weakCompareAndSet(this, s1, "nogo"); assert str == s2; } }