On Sep 3, 2013, at 4:46 PM, Doug Lea wrote: > I assume you mean to change line 898: > > if (rnd == null) { > rnd = ThreadLocalRandom.current();; // was: getSecureRandom(); > }
Yes. > This seems fine in terms of sufficient RNG quality and better > performance. Also in terns of being for sure thread-safe > even though it uses no locks/sync: there are no possible async > or parallel calls from entry into this method, so using > thread-local one is fine. Thanks for the comments. One question I have is whether this change would still be needed if public boolean isProbablePrime(int certainty, Random rnd) {} were added. Brian