--- jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.java 2013/05/30 03:28:55 1.29 +++ jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.java 2014/12/31 19:21:20 1.31 @@ -6,9 +6,11 @@ * Pat Fisher, Mike Judd. */ -import junit.framework.*; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; +import junit.framework.Test; +import junit.framework.TestSuite; + public class AtomicReferenceFieldUpdaterTest extends JSR166TestCase { volatile Integer x = null; Object z; @@ -143,10 +145,10 @@ public class AtomicReferenceFieldUpdater AtomicReferenceFieldUpdatera; a = updaterFor("x"); x = one; - while (!a.weakCompareAndSet(this, one, two)); - while (!a.weakCompareAndSet(this, two, m4)); + do {} while (!a.weakCompareAndSet(this, one, two)); + do {} while (!a.weakCompareAndSet(this, two, m4)); assertSame(m4, a.get(this)); - while (!a.weakCompareAndSet(this, m4, seven)); + do {} while (!a.weakCompareAndSet(this, m4, seven)); assertSame(seven, a.get(this)); }