Demonstrating a bug in java.util.Random

This commit is contained in:
marcin.sciesinski
2019-09-20 13:02:34 -07:00
parent 34b71d06d7
commit ba6476f51f

View File

@@ -89,7 +89,7 @@ public class HobbitDraftTest {
private static void doRandomTest(int nextIntValue, boolean getFloatBeforeInt) {
System.out.println("Get float before int: " + getFloatBeforeInt);
System.out.println("Next int value: " + nextIntValue);
int[] values = new int[4];
int[] values = new int[nextIntValue];
for (int i = 0; i < 1000; i++) {
Random rnd = new Random(i);
if (getFloatBeforeInt)