ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/Random.java
(Generate patch)

Comparing jsr166/src/main/java/util/Random.java (file contents):
Revision 1.31 by jsr166, Mon Jan 2 23:40:59 2012 UTC vs.
Revision 1.32 by dl, Wed Jan 16 19:01:22 2013 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
2 > * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4   *
5   * This code is free software; you can redistribute it and/or modify it
# Line 26 | Line 26
26   package java.util;
27   import java.io.*;
28   import java.util.concurrent.atomic.AtomicLong;
29 + import java.util.stream.IntStream;
30 + import java.util.stream.Streams;
31 +
32   import sun.misc.Unsafe;
33  
34   /**
# Line 121 | Line 124 | class Random implements java.io.Serializ
124          if (getClass() == Random.class)
125              this.seed = new AtomicLong(initialScramble(seed));
126          else {
127 <            // subclass might have overridden setSeed
127 >            // subclass might have overriden setSeed
128              this.seed = new AtomicLong();
129              setSeed(seed);
130          }
# Line 512 | Line 515 | class Random implements java.io.Serializ
515          }
516      }
517  
518 +    public IntStream ints() {
519 +        return Streams.generateInt(this::nextInt);
520 +    }
521 +
522      /**
523       * Serializable fields for Random.
524       *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines