You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "John Mark (JIRA)" <ji...@apache.org> on 2016/08/04 14:40:20 UTC

[jira] [Created] (LANG-1254) ThreadLocalRandom should be used in utility classes

John Mark created LANG-1254:
-------------------------------

             Summary: ThreadLocalRandom should be used in utility classes
                 Key: LANG-1254
                 URL: https://issues.apache.org/jira/browse/LANG-1254
             Project: Commons Lang
          Issue Type: Improvement
            Reporter: John Mark
            Priority: Minor


I noticed that both {{RandomUtils}} and {{RandomStringUtils}} use a constant for the {{Random}} instance. The javadoc for [Random|http://docs.oracle.com/javase/8/docs/api/java/util/Random.html] indicates that [ThreadLocalRandom|http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadLocalRandom.html] should be used for performance in multithreaded designs. I would think that a public utility class would qualify as a multithreaded design and should therefore use {{ThreadLocalRandom}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)