--- jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.java 2009/11/02 20:28:31 1.11 +++ jsr166/src/test/tck/AtomicReferenceFieldUpdaterTest.java 2009/11/16 04:57:10 1.12 @@ -26,7 +26,7 @@ public class AtomicReferenceFieldUpdater * Construction with non-existent field throws RuntimeException */ public void testConstructor(){ - try{ + try { AtomicReferenceFieldUpdater a = AtomicReferenceFieldUpdater.newUpdater (AtomicReferenceFieldUpdaterTest.class, Integer.class, "y"); @@ -40,7 +40,7 @@ public class AtomicReferenceFieldUpdater * construction with field not of given type throws RuntimeException */ public void testConstructor2(){ - try{ + try { AtomicReferenceFieldUpdater a = AtomicReferenceFieldUpdater.newUpdater (AtomicReferenceFieldUpdaterTest.class, Integer.class, "z"); @@ -53,7 +53,7 @@ public class AtomicReferenceFieldUpdater * Constructor with non-volatile field throws exception */ public void testConstructor3(){ - try{ + try { AtomicReferenceFieldUpdater a = AtomicReferenceFieldUpdater.newUpdater (AtomicReferenceFieldUpdaterTest.class, Integer.class, "w"); @@ -133,7 +133,7 @@ public class AtomicReferenceFieldUpdater Thread t = new Thread(new Runnable() { public void run() { - while(!a.compareAndSet(AtomicReferenceFieldUpdaterTest.this, two, three)) Thread.yield(); + while (!a.compareAndSet(AtomicReferenceFieldUpdaterTest.this, two, three)) Thread.yield(); }}); try { t.start(); @@ -142,7 +142,7 @@ public class AtomicReferenceFieldUpdater assertFalse(t.isAlive()); assertEquals(a.get(this), three); } - catch(Exception e) { + catch (Exception e) { unexpectedException(); } } @@ -159,10 +159,10 @@ public class AtomicReferenceFieldUpdater return; } x = one; - while(!a.weakCompareAndSet(this,one,two)); - while(!a.weakCompareAndSet(this,two,m4)); + while (!a.weakCompareAndSet(this,one,two)); + while (!a.weakCompareAndSet(this,two,m4)); assertEquals(m4,a.get(this)); - while(!a.weakCompareAndSet(this,m4,seven)); + while (!a.weakCompareAndSet(this,m4,seven)); assertEquals(seven,a.get(this)); }