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.30 by jsr166, Sat Jan 2 02:27:03 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 >        java.security.PrivilegedAction<Boolean> action =
229 >            () -> Boolean.getBoolean("java.util.secureRandomSeed");
230 >        if (java.security.AccessController.doPrivileged(action)) {
231              byte[] seedBytes = java.security.SecureRandom.getSeed(8);
232 <            long s = (long)(seedBytes[0]) & 0xffL;
232 >            long s = (long)seedBytes[0] & 0xffL;
233              for (int i = 1; i < 8; ++i)
234 <                s = (s << 8) | ((long)(seedBytes[i]) & 0xffL);
234 >                s = (s << 8) | ((long)seedBytes[i] & 0xffL);
235              return s;
236          }
237          return (mix64(System.currentTimeMillis()) ^
# Line 825 | Line 824 | public final class SplittableRandom {
824       * approach. The long and double versions of this class are
825       * identical except for types.
826       */
827 <    static final class RandomIntsSpliterator implements Spliterator.OfInt {
827 >    private static final class RandomIntsSpliterator
828 >            implements Spliterator.OfInt {
829          final SplittableRandom rng;
830          long index;
831          final long fence;
# Line 880 | Line 880 | public final class SplittableRandom {
880      /**
881       * Spliterator for long streams.
882       */
883 <    static final class RandomLongsSpliterator implements Spliterator.OfLong {
883 >    private static final class RandomLongsSpliterator
884 >            implements Spliterator.OfLong {
885          final SplittableRandom rng;
886          long index;
887          final long fence;
# Line 936 | Line 937 | public final class SplittableRandom {
937      /**
938       * Spliterator for double streams.
939       */
940 <    static final class RandomDoublesSpliterator implements Spliterator.OfDouble {
940 >    private static final class RandomDoublesSpliterator
941 >            implements Spliterator.OfDouble {
942          final SplittableRandom rng;
943          long index;
944          final long fence;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines