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 |
> |
if (java.security.AccessController.doPrivileged( |
229 |
> |
new java.security.PrivilegedAction<Boolean>() { |
230 |
> |
public Boolean run() { |
231 |
> |
return Boolean.getBoolean("java.util.secureRandomSeed"); |
232 |
> |
}})) { |
233 |
|
byte[] seedBytes = java.security.SecureRandom.getSeed(8); |
234 |
< |
long s = (long)(seedBytes[0]) & 0xffL; |
234 |
> |
long s = (long)seedBytes[0] & 0xffL; |
235 |
|
for (int i = 1; i < 8; ++i) |
236 |
< |
s = (s << 8) | ((long)(seedBytes[i]) & 0xffL); |
236 |
> |
s = (s << 8) | ((long)seedBytes[i] & 0xffL); |
237 |
|
return s; |
238 |
|
} |
239 |
|
return (mix64(System.currentTimeMillis()) ^ |
826 |
|
* approach. The long and double versions of this class are |
827 |
|
* identical except for types. |
828 |
|
*/ |
829 |
< |
static final class RandomIntsSpliterator implements Spliterator.OfInt { |
829 |
> |
private static final class RandomIntsSpliterator |
830 |
> |
implements Spliterator.OfInt { |
831 |
|
final SplittableRandom rng; |
832 |
|
long index; |
833 |
|
final long fence; |
882 |
|
/** |
883 |
|
* Spliterator for long streams. |
884 |
|
*/ |
885 |
< |
static final class RandomLongsSpliterator implements Spliterator.OfLong { |
885 |
> |
private static final class RandomLongsSpliterator |
886 |
> |
implements Spliterator.OfLong { |
887 |
|
final SplittableRandom rng; |
888 |
|
long index; |
889 |
|
final long fence; |
939 |
|
/** |
940 |
|
* Spliterator for double streams. |
941 |
|
*/ |
942 |
< |
static final class RandomDoublesSpliterator implements Spliterator.OfDouble { |
942 |
> |
private static final class RandomDoublesSpliterator |
943 |
> |
implements Spliterator.OfDouble { |
944 |
|
final SplittableRandom rng; |
945 |
|
long index; |
946 |
|
final long fence; |