20 |
|
import java.util.stream.LongStream; |
21 |
|
import java.util.stream.StreamSupport; |
22 |
|
import jdk.internal.misc.Unsafe; |
23 |
+ |
import jdk.internal.misc.VM; |
24 |
|
|
25 |
|
/** |
26 |
|
* A random number generator isolated to the current thread. Like the |
1065 |
|
|
1066 |
|
// at end of <clinit> to survive static initialization circularity |
1067 |
|
static { |
1068 |
< |
if (java.security.AccessController.doPrivileged( |
1069 |
< |
new java.security.PrivilegedAction<>() { |
1069 |
< |
public Boolean run() { |
1070 |
< |
return Boolean.getBoolean("java.util.secureRandomSeed"); |
1071 |
< |
}})) { |
1068 |
> |
String sec = VM.getSavedProperty("java.util.secureRandomSeed"); |
1069 |
> |
if (sec != null && Boolean.parseBoolean(sec)) { |
1070 |
|
byte[] seedBytes = java.security.SecureRandom.getSeed(8); |
1071 |
|
long s = (long)seedBytes[0] & 0xffL; |
1072 |
|
for (int i = 1; i < 8; ++i) |