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.28 by jsr166, Sat Sep 19 21:07:10 2015 UTC vs.
Revision 1.31 by jsr166, Fri Feb 19 03:39:15 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 >        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()) ^
# Line 825 | Line 826 | public final class SplittableRandom {
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;
# Line 880 | Line 882 | public final class SplittableRandom {
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;
# Line 936 | Line 939 | public final class SplittableRandom {
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines