You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2007/11/21 00:27:50 UTC
svn commit: r596877 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/util/OERandom.java
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;