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 |
|
} |
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"); |
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; |
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 |