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.29 by jsr166, Sun Sep 20 02:41:36 2015 UTC vs.
Revision 1.30 by jsr166, Sat Jan 2 02:27:03 2016 UTC

# Line 225 | Line 225 | public final class SplittableRandom {
225      private static final AtomicLong defaultGen = new AtomicLong(initialSeed());
226  
227      private static long initialSeed() {
228 <        String pp = java.security.AccessController.doPrivileged(
229 <                new sun.security.action.GetPropertyAction(
230 <                        "java.util.secureRandomSeed"));
231 <        if (pp != null && pp.equalsIgnoreCase("true")) {
228 >        java.security.PrivilegedAction<Boolean> action =
229 >            () -> Boolean.getBoolean("java.util.secureRandomSeed");
230 >        if (java.security.AccessController.doPrivileged(action)) {
231              byte[] seedBytes = java.security.SecureRandom.getSeed(8);
232 <            long s = (long)(seedBytes[0]) & 0xffL;
232 >            long s = (long)seedBytes[0] & 0xffL;
233              for (int i = 1; i < 8; ++i)
234 <                s = (s << 8) | ((long)(seedBytes[i]) & 0xffL);
234 >                s = (s << 8) | ((long)seedBytes[i] & 0xffL);
235              return s;
236          }
237          return (mix64(System.currentTimeMillis()) ^

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines