MCPcopy Create free account
hub / github.com/spotbugs/spotbugs / nextInt

Method nextInt

spotbugsTestCases/src/java/BadRandomInt.java:10–13  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

8 static Random r = new Random();
9
10 @ExpectWarning("Dm")
11 int nextInt(int n) {
12 return (int) (r.nextDouble() * n);
13 }
14
15 @ExpectWarning("Dm")
16 int nextInt() {

Callers 15

randomIntMethod · 0.80
randomInt2Method · 0.80
randomInt3Method · 0.80
mainMethod · 0.80
getRandomElementMethod · 0.80
getRandomElement2Method · 0.80
getRandomStringMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected