Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/java/util/concurrent/ThreadLocalRandom.java
          +++ new/src/share/classes/java/util/concurrent/ThreadLocalRandom.java
↓ open down ↓ 55 lines elided ↑ open up ↑
  56   56   * accidently share a {@code ThreadLocalRandom} across multiple threads.
  57   57   *
  58   58   * <p>This class also provides additional commonly used bounded random
  59   59   * generation methods.
  60   60   *
  61   61   * @since 1.7
  62   62   * @author Doug Lea
  63   63   */
  64   64  public class ThreadLocalRandom extends Random {
  65   65      // same constants as Random, but must be redeclared because private
  66      -    private final static long multiplier = 0x5DEECE66DL;
  67      -    private final static long addend = 0xBL;
  68      -    private final static long mask = (1L << 48) - 1;
       66 +    private static final long multiplier = 0x5DEECE66DL;
       67 +    private static final long addend = 0xBL;
       68 +    private static final long mask = (1L << 48) - 1;
  69   69  
  70   70      /**
  71   71       * The random seed. We can't use super.seed.
  72   72       */
  73   73      private long rnd;
  74   74  
  75   75      /**
  76   76       * Initialization flag to permit calls to setSeed to succeed only
  77   77       * while executing the Random constructor.  We can't allow others
  78   78       * since it would cause setting seed in one part of a program to
↓ open down ↓ 148 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX