8150014: java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java fails with NoClassDefFoundError

Reviewed-by: martin, psandoz, darcy, mhaupt, dholmes
This commit is contained in:
Doug Lea 2016-02-20 12:19:36 -08:00
parent 540c76f5b1
commit 2b446bf074
2 changed files with 10 additions and 6 deletions

View File

@ -225,9 +225,11 @@ public final class SplittableRandom {
private static final AtomicLong defaultGen = new AtomicLong(initialSeed());
private static long initialSeed() {
java.security.PrivilegedAction<Boolean> action =
() -> Boolean.getBoolean("java.util.secureRandomSeed");
if (java.security.AccessController.doPrivileged(action)) {
if (java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Boolean>() {
public Boolean run() {
return Boolean.getBoolean("java.util.secureRandomSeed");
}})) {
byte[] seedBytes = java.security.SecureRandom.getSeed(8);
long s = (long)seedBytes[0] & 0xffL;
for (int i = 1; i < 8; ++i)

View File

@ -134,9 +134,11 @@ public class ThreadLocalRandom extends Random {
private static final AtomicLong seeder = new AtomicLong(initialSeed());
private static long initialSeed() {
java.security.PrivilegedAction<Boolean> action =
() -> Boolean.getBoolean("java.util.secureRandomSeed");
if (java.security.AccessController.doPrivileged(action)) {
if (java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Boolean>() {
public Boolean run() {
return Boolean.getBoolean("java.util.secureRandomSeed");
}})) {
byte[] seedBytes = java.security.SecureRandom.getSeed(8);
long s = (long)seedBytes[0] & 0xffL;
for (int i = 1; i < 8; ++i)