Code Review 7051516: ThreadLocalRandom seed is never initialized so all instances generate the same sequence (original) (raw)
Chris Hegarty chris.hegarty at oracle.com
Thu Jun 16 10🔞37 UTC 2011
- Previous message: JDK 8 code review request for 7055295: (reflect) add conventional constructor to GenericSignatureFormatError
- Next message: Code Review 7051516: ThreadLocalRandom seed is never initialized so all instances generate the same sequence
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
ThreadLocalRandom uses its own seed, not the seed of the super class.
ThreadLocalRandom() {
super();
initialized = true;
}
This uselessly initializes the parent seed via the default constructor but leaves the real seed at zero.
Webrev: http://cr.openjdk.java.net/~chegar/7051516/jdk8_webrev.00/webrev/
Note: This is a port of the fix from Doug's CVS to OpenJDK. A test has been added to Doug's CVS tck tests for ThreadLocalRandom, and I will file a CR against the JCK to have it pulled in to JCK8.
-Chris.
- Previous message: JDK 8 code review request for 7055295: (reflect) add conventional constructor to GenericSignatureFormatError
- Next message: Code Review 7051516: ThreadLocalRandom seed is never initialized so all instances generate the same sequence
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]