google / google/error-prone

Use 'ThreadLocalRandom' instead of 'java.util.Random'

Open
#1,304 1 comment 0 reactions 0 assignees View on GitHub
Type-NewCheck
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

Can we create a check to use `java.util.concurrent.ThreadLocalRandom.current().nextInt()` instead of `java.util.Random.nextInt()` and `java.lang.Math.random()`.

Reference: https://stackoverflow.com/a/363692/950427

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.