You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by "Patricia Shanahan (JIRA)" <ji...@apache.org> on 2010/09/27 00:35:33 UTC
[jira] Created: (RIVER-352) com.sun.jini.test.share.TxnTestUtils
misuses java.util.Random
com.sun.jini.test.share.TxnTestUtils misuses java.util.Random
-------------------------------------------------------------
Key: RIVER-352
URL: https://issues.apache.org/jira/browse/RIVER-352
Project: River
Issue Type: Test
Components: other
Environment: Any
Reporter: Patricia Shanahan
Priority: Trivial
In the static method chooseOne, com.sun.jini.test.share.TxnTestUtils creates a java.util.Random for a single use, without reporting the seed or providing any way to set the seed.
Creating a lot of Random instances has no guarantees of statistical properties - all that can be promised is that the seed is very likely to be different. Nothing is said about its distribution.
Unless the seed is reported and can be set, preferably through a configuration parameter, it is impossible to arrange for repeated tests using the same random number sequence. See com.sun.jini.test.impl.mahalo.RandomStressTest, field "random", for correct handling of this issue.
As an alternative to having its own seed configuration parameter, TxnTestUtils could require its caller to supply a Random.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.