jdk/src/share/classes/java/util/Random.java
changeset 10056 7464dc04ae22
parent 7668 d4a77089c587
child 14342 8435a30053c1
--- a/jdk/src/share/classes/java/util/Random.java	Mon Jun 20 17:38:15 2011 +0800
+++ b/jdk/src/share/classes/java/util/Random.java	Mon Jun 20 12:27:20 2011 +0100
@@ -118,7 +118,13 @@
      * @see   #setSeed(long)
      */
     public Random(long seed) {
-        this.seed = new AtomicLong(initialScramble(seed));
+        if (getClass() == Random.class)
+            this.seed = new AtomicLong(initialScramble(seed));
+        else {
+            // subclass might have overriden setSeed
+            this.seed = new AtomicLong();
+            setSeed(seed);
+        }
     }
 
     private static long initialScramble(long seed) {