[cvs] / jsr166 / src / main / java / util / SplittableRandom.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/SplittableRandom.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29, Sun Sep 20 02:41:36 2015 UTC revision 1.30, Sat Jan 2 02:27:03 2016 UTC
# Line 225  Line 225 
225      private static final AtomicLong defaultGen = new AtomicLong(initialSeed());      private static final AtomicLong defaultGen = new AtomicLong(initialSeed());
226    
227      private static long initialSeed() {      private static long initialSeed() {
228          String pp = java.security.AccessController.doPrivileged(          java.security.PrivilegedAction<Boolean> action =
229                  new sun.security.action.GetPropertyAction(              () -> Boolean.getBoolean("java.util.secureRandomSeed");
230                          "java.util.secureRandomSeed"));          if (java.security.AccessController.doPrivileged(action)) {
         if (pp != null && pp.equalsIgnoreCase("true")) {  
231              byte[] seedBytes = java.security.SecureRandom.getSeed(8);              byte[] seedBytes = java.security.SecureRandom.getSeed(8);
232              long s = (long)(seedBytes[0]) & 0xffL;              long s = (long)seedBytes[0] & 0xffL;
233              for (int i = 1; i < 8; ++i)              for (int i = 1; i < 8; ++i)
234                  s = (s << 8) | ((long)(seedBytes[i]) & 0xffL);                  s = (s << 8) | ((long)seedBytes[i] & 0xffL);
235              return s;              return s;
236          }          }
237          return (mix64(System.currentTimeMillis()) ^          return (mix64(System.currentTimeMillis()) ^

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8