ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/extra/AtomicDouble.java
(Generate patch)

Comparing jsr166/src/jsr166e/extra/AtomicDouble.java (file contents):
Revision 1.10 by jsr166, Thu Oct 20 17:47:36 2011 UTC vs.
Revision 1.11 by jsr166, Tue Oct 25 19:21:27 2011 UTC

# Line 40 | Line 40 | import static java.lang.Double.longBitsT
40   public class AtomicDouble extends Number implements java.io.Serializable {
41      private static final long serialVersionUID = -8405198993435143622L;
42  
43 <    private volatile long value;
43 >    private volatile transient long value;
44  
45      /**
46       * Creates a new {@code AtomicDouble} with the given initial value.
# Line 210 | Line 210 | public class AtomicDouble extends Number
210          return get();
211      }
212  
213 +    /**
214 +     * Saves the state to a stream (that is, serializes it).
215 +     *
216 +     * @serialData The current value is emitted (a {@code double}).
217 +     */
218 +    private void writeObject(java.io.ObjectOutputStream s)
219 +        throws java.io.IOException{
220 +        s.defaultWriteObject();
221 +
222 +        s.writeDouble(get());
223 +    }
224 +
225 +    /**
226 +     * Reconstitutes the instance from a stream (that is, deserializes it).
227 +     */
228 +    private void readObject(java.io.ObjectInputStream s)
229 +        throws java.io.IOException, ClassNotFoundException {
230 +        s.defaultReadObject();
231 +
232 +        set(s.readDouble());
233 +    }
234 +
235      // Unsafe mechanics
236      private static final sun.misc.Unsafe unsafe = getUnsafe();
237      private static final long valueOffset;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines