db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r596877 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/util/OERandom.java
Date Tue, 20 Nov 2007 23:27:50 GMT
Author: djd
Date: Tue Nov 20 15:27:50 2007
New Revision: 596877

URL: http://svn.apache.org/viewvc?rev=596877&view=rev
Log:
Fix the OERandom constructor that creates a OERandom from another not to have an identical
seed to another created at the same time.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/util/OERandom.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/util/OERandom.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/util/OERandom.java?rev=596877&r1=596876&r2=596877&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/util/OERandom.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/util/OERandom.java
Tue Nov 20 15:27:50 2007
@@ -47,7 +47,10 @@
      * @param oer
      */
     public OERandom(OERandom oer) {
-        rand = new Random(System.currentTimeMillis());
+        // Since these objects may be created at the same time,
+        // within the resolution of currentTimeMillis(), then
+        // ensure they have different seeds.
+        rand = new Random(System.currentTimeMillis() + oer.rand.nextLong());
         Clast = oer.Clast;
         Cid = oer.Cid;
         Citem = oer.Citem;



Mime
View raw message