--- jsr166/src/test/tck/AtomicLongFieldUpdaterTest.java 2013/04/02 04:11:28 1.25 +++ jsr166/src/test/tck/AtomicLongFieldUpdaterTest.java 2014/12/31 19:21:20 1.28 @@ -6,9 +6,11 @@ * Pat Fisher, Mike Judd. */ -import junit.framework.*; import java.util.concurrent.atomic.AtomicLongFieldUpdater; +import junit.framework.Test; +import junit.framework.TestSuite; + public class AtomicLongFieldUpdaterTest extends JSR166TestCase { volatile long x = 0; int z; @@ -34,7 +36,7 @@ public class AtomicLongFieldUpdaterTest updaterFor("y"); shouldThrow(); } catch (RuntimeException success) { - assertTrue(success.getCause() != null); + assertNotNull(success.getCause()); } } @@ -132,10 +134,10 @@ public class AtomicLongFieldUpdaterTest AtomicLongFieldUpdater a; a = updaterFor("x"); x = 1; - while (!a.weakCompareAndSet(this, 1, 2)); - while (!a.weakCompareAndSet(this, 2, -4)); + do {} while (!a.weakCompareAndSet(this, 1, 2)); + do {} while (!a.weakCompareAndSet(this, 2, -4)); assertEquals(-4, a.get(this)); - while (!a.weakCompareAndSet(this, -4, 7)); + do {} while (!a.weakCompareAndSet(this, -4, 7)); assertEquals(7, a.get(this)); }