--- jsr166/src/test/tck/AtomicLongFieldUpdaterTest.java 2009/11/21 02:07:26 1.15 +++ jsr166/src/test/tck/AtomicLongFieldUpdaterTest.java 2011/05/27 19:39:07 1.20 @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ * Other contributors include Andrew Wright, Jeffrey Hayes, * Pat Fisher, Mike Judd. */ @@ -31,8 +31,7 @@ public class AtomicLongFieldUpdaterTest a = AtomicLongFieldUpdater.newUpdater (AtomicLongFieldUpdaterTest.class, "y"); shouldThrow(); - } - catch (RuntimeException rt) {} + } catch (RuntimeException success) {} } /** @@ -44,8 +43,7 @@ public class AtomicLongFieldUpdaterTest a = AtomicLongFieldUpdater.newUpdater (AtomicLongFieldUpdaterTest.class, "z"); shouldThrow(); - } - catch (RuntimeException rt) {} + } catch (RuntimeException success) {} } /** @@ -57,13 +55,11 @@ public class AtomicLongFieldUpdaterTest a = AtomicLongFieldUpdater.newUpdater (AtomicLongFieldUpdaterTest.class, "w"); shouldThrow(); - } - - catch (RuntimeException rt) {} + } catch (RuntimeException success) {} } /** - * get returns the last value set or assigned + * get returns the last value set or assigned */ public void testGetSet() { AtomicLongFieldUpdater a; @@ -81,7 +77,7 @@ public class AtomicLongFieldUpdaterTest } /** - * get returns the last value lazySet by same thread + * get returns the last value lazySet by same thread */ public void testGetLazySet() { AtomicLongFieldUpdater a; @@ -98,7 +94,6 @@ public class AtomicLongFieldUpdaterTest assertEquals(-3,a.get(this)); } - /** * compareAndSet succeeds in changing value if equal to expected else fails */ @@ -114,12 +109,11 @@ public class AtomicLongFieldUpdaterTest assertTrue(a.compareAndSet(this,2,-4)); assertEquals(-4,a.get(this)); assertFalse(a.compareAndSet(this,-5,7)); - assertFalse((7 == a.get(this))); + assertEquals(-4,a.get(this)); assertTrue(a.compareAndSet(this,-4,7)); assertEquals(7,a.get(this)); } - /** * compareAndSet in one thread enables another waiting for value * to succeed @@ -166,7 +160,7 @@ public class AtomicLongFieldUpdaterTest } /** - * getAndSet returns previous value and sets to given value + * getAndSet returns previous value and sets to given value */ public void testGetAndSet() { AtomicLongFieldUpdater a; @@ -252,7 +246,7 @@ public class AtomicLongFieldUpdaterTest } /** - * decrementAndGet decrements and returns current value + * decrementAndGet decrements and returns current value */ public void testDecrementAndGet() { AtomicLongFieldUpdater a;