commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Mark (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LANG-1254) ThreadLocalRandom should be used in utility classes
Date Thu, 04 Aug 2016 14:40:20 GMT
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)

Mime
View raw message