Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1254

ThreadLocalRandom should be used in utility classes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      I noticed that both RandomUtils and RandomStringUtils use a constant for the Random instance. The javadoc for Random indicates that ThreadLocalRandom 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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jmark John Mark
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: