Remove references to Random from production code, closes https://github.com/OpenHFT/Chronicle-Core/issues/218

This commit is contained in:
Peter Lawrey
2021-03-24 12:16:55 +00:00
parent 09c73f059c
commit 44dcf5ef2c
2 changed files with 4 additions and 5 deletions
@@ -6,7 +6,7 @@ import net.openhft.chronicle.threads.NamedThreadFactory;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.Random;
import java.security.SecureRandom;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.IntStream;
@@ -105,7 +105,7 @@ public class MapStress {
long written = 0;
do {
long time = System.currentTimeMillis();
final Random random = ThreadLocalRandom.current();
final SecureRandom random = new SecureRandom();
IntStream.range(0, 10).forEach(x -> {
final int keyIdx = random.nextInt(N_WRITE_THREADS * 100);
Security sec = secs[x % 5];