ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ThreadLocalRandom.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ThreadLocalRandom.java (file contents):
Revision 1.11 by jsr166, Mon Jan 28 17:42:42 2013 UTC vs.
Revision 1.12 by jsr166, Tue Feb 19 19:21:44 2013 UTC

# Line 343 | Line 343 | public class ThreadLocalRandom extends R
343      private static final long serialVersionUID = -5851777807851030925L;
344  
345      /**
346     * @serialField rnd long
347     * @serialField initialized boolean
348     * @serialField pad0 long
349     * @serialField pad1 long
350     * @serialField pad2 long
351     * @serialField pad3 long
352     * @serialField pad4 long
353     * @serialField pad5 long
354     * @serialField pad6 long
355     * @serialField pad7 long
356     */
357    private static final ObjectStreamField[] serialPersistentFields = {
358            new ObjectStreamField("rnd", long.class),
359            new ObjectStreamField("initialized", boolean.class),
360            new ObjectStreamField("pad0", long.class),
361            new ObjectStreamField("pad1", long.class),
362            new ObjectStreamField("pad2", long.class),
363            new ObjectStreamField("pad3", long.class),
364            new ObjectStreamField("pad4", long.class),
365            new ObjectStreamField("pad5", long.class),
366            new ObjectStreamField("pad6", long.class),
367            new ObjectStreamField("pad7", long.class) };
368
369    /**
370     * Saves the {@code ThreadLocalRandom} to a stream (that is, serializes it).
371     */
372    private void writeObject(java.io.ObjectOutputStream out)
373        throws java.io.IOException {
374
375        java.io.ObjectOutputStream.PutField fields = out.putFields();
376        fields.put("rnd", 0L);
377        fields.put("initialized", true);
378        fields.put("pad0", 0L);
379        fields.put("pad1", 0L);
380        fields.put("pad2", 0L);
381        fields.put("pad3", 0L);
382        fields.put("pad4", 0L);
383        fields.put("pad5", 0L);
384        fields.put("pad6", 0L);
385        fields.put("pad7", 0L);
386        out.writeFields();
387    }
388
389    /**
346       * Returns the {@link #current() current} thread's {@code ThreadLocalRandom}.
347       */
348      private Object readResolve() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines