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

Comparing jsr166/src/main/java/util/SplittableRandom.java (file contents):
Revision 1.21 by dl, Thu Sep 19 23:19:43 2013 UTC vs.
Revision 1.23 by dl, Fri Sep 20 14:06:46 2013 UTC

# Line 25 | Line 25
25  
26   package java.util;
27  
28 import java.security.SecureRandom;
28   import java.net.NetworkInterface;
30 import java.util.Enumeration;
29   import java.util.concurrent.atomic.AtomicLong;
30   import java.util.function.IntConsumer;
31   import java.util.function.LongConsumer;
# Line 89 | Line 87 | import java.util.stream.DoubleStream;
87   * @author  Doug Lea
88   * @since   1.8
89   */
90 < public class SplittableRandom {
90 > public final class SplittableRandom {
91  
92      /*
93       * Implementation Overview.
# Line 197 | Line 195 | public class SplittableRandom {
195          return z ^ (z >>> 32);
196      }
197  
200    private static long xmix64(long z) {
201        z *= 0xbf58476d1ce4e5b9L;
202        z = (z ^ (z >>> 27)) * 0x94d049bb133111ebL;
203        return z ^ (z >>> 31);
204    }
205
198      /**
199       * Returns the 32 high bits of Stafford variant 4 mix64 function as int.
200       */
# Line 248 | Line 240 | public class SplittableRandom {
240          long h = 0L;
241          try {
242              Enumeration<NetworkInterface> ifcs =
243 <                NetworkInterface.getNetworkInterfaces();
243 >                    NetworkInterface.getNetworkInterfaces();
244              boolean retry = false; // retry once if getHardwareAddress is null
245              while (ifcs.hasMoreElements()) {
246                  NetworkInterface ifc = ifcs.nextElement();
# Line 410 | Line 402 | public class SplittableRandom {
402       * may, and typically does, vary across program invocations.
403       */
404      public SplittableRandom() { // emulate defaultGen.split()
405 <        long s = defaultGen.getAndAdd(2*GOLDEN_GAMMA);
405 >        long s = defaultGen.getAndAdd(2 * GOLDEN_GAMMA);
406          this.seed = mix64(s);
407          this.gamma = mixGamma(s + GOLDEN_GAMMA);
408      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines