Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8283683

Make ThreadLocalRandom a final class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • None
    • core-libs
    • None

      The class java.util.concurrent.ThreadLocalRandom is a public class. However, it has one sole constructor which is private:

      private ThreadLocalRandom() {
      ...
      }

      This makes it eligible to be marked as final and doing so will also better convey its extensibility.

            jpai Jaikiran Pai
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: