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.38 by jsr166, Sun Sep 20 17:03:23 2015 UTC vs.
Revision 1.39 by jsr166, Sat Jan 2 02:27:03 2016 UTC

# Line 105 | Line 105 | public class ThreadLocalRandom extends R
105      private static final AtomicLong seeder = new AtomicLong(initialSeed());
106  
107      private static long initialSeed() {
108 <        String pp = java.security.AccessController.doPrivileged(
109 <                new sun.security.action.GetPropertyAction(
110 <                        "java.util.secureRandomSeed"));
111 <        if (pp != null && pp.equalsIgnoreCase("true")) {
108 >        java.security.PrivilegedAction<Boolean> action =
109 >            () -> Boolean.getBoolean("java.util.secureRandomSeed");
110 >        if (java.security.AccessController.doPrivileged(action)) {
111              byte[] seedBytes = java.security.SecureRandom.getSeed(8);
112 <            long s = (long)(seedBytes[0]) & 0xffL;
112 >            long s = (long)seedBytes[0] & 0xffL;
113              for (int i = 1; i < 8; ++i)
114 <                s = (s << 8) | ((long)(seedBytes[i]) & 0xffL);
114 >                s = (s << 8) | ((long)seedBytes[i] & 0xffL);
115              return s;
116          }
117          return (mix64(System.currentTimeMillis()) ^

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines