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

Comparing jsr166/src/jdk7/java/util/Random.java (file contents):
Revision 1.1 by dl, Sun Dec 16 20:55:09 2012 UTC vs.
Revision 1.3 by jsr166, Sat Feb 16 20:50:29 2013 UTC

# Line 150 | Line 150 | class Random implements java.io.Serializ
150       *
151       * @param seed the initial seed
152       */
153 <    synchronized public void setSeed(long seed) {
153 >    public synchronized void setSeed(long seed) {
154          this.seed.set(initialScramble(seed));
155          haveNextNextGaussian = false;
156      }
# Line 294 | Line 294 | class Random implements java.io.Serializ
294       * @throws IllegalArgumentException if n is not positive
295       * @since 1.2
296       */
297
297      public int nextInt(int n) {
298          if (n <= 0)
299              throw new IllegalArgumentException("n must be positive");
# Line 493 | Line 492 | class Random implements java.io.Serializ
492       *         standard deviation {@code 1.0} from this random number
493       *         generator's sequence
494       */
495 <    synchronized public double nextGaussian() {
495 >    public synchronized double nextGaussian() {
496          // See Knuth, ACP, Section 3.4.1 Algorithm C.
497          if (haveNextNextGaussian) {
498              haveNextNextGaussian = false;
# Line 551 | Line 550 | class Random implements java.io.Serializ
550      /**
551       * Save the {@code Random} instance to a stream.
552       */
553 <    synchronized private void writeObject(ObjectOutputStream s)
553 >    private synchronized void writeObject(ObjectOutputStream s)
554          throws IOException {
555  
556          // set the values of the Serializable fields

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines