--- jsr166/src/jsr166e/extra/AtomicDouble.java 2011/08/10 04:35:04 1.6 +++ jsr166/src/jsr166e/extra/AtomicDouble.java 2011/10/20 16:33:25 1.9 @@ -31,11 +31,14 @@ import static java.lang.Double.longBitsT * return xBits == yBits; * }} * + * @see jsr166e.DoubleAdder + * @see jsr166e.DoubleMaxUpdater + * * @author Doug Lea * @author Martin Buchholz */ public class AtomicDouble extends Number implements java.io.Serializable { - static final long serialVersionUID = -8405198993435143622L; + private static final long serialVersionUID = -8405198993435143622L; private volatile long value; @@ -51,7 +54,9 @@ public class AtomicDouble extends Number /** * Creates a new {@code AtomicDouble} with initial value {@code 0.0}. */ - public AtomicDouble() { this(0.0); } + public AtomicDouble() { + // assert doubleToRawLongBits(0.0) == 0L; + } /** * Gets the current value. @@ -118,7 +123,9 @@ public class AtomicDouble extends Number * if the current value is bitwise equal * to the expected value. * - *

May fail spuriously + *

May + * fail spuriously * and does not provide ordering guarantees, so is only rarely an * appropriate alternative to {@code compareAndSet}. * @@ -177,7 +184,7 @@ public class AtomicDouble extends Number * after a narrowing primitive conversion. */ public int intValue() { - return (int)get(); + return (int) get(); } /** @@ -185,7 +192,7 @@ public class AtomicDouble extends Number * after a narrowing primitive conversion. */ public long longValue() { - return (long)get(); + return (long) get(); } /** @@ -193,7 +200,7 @@ public class AtomicDouble extends Number * after a narrowing primitive conversion. */ public float floatValue() { - return (float)get(); + return (float) get(); } /**