updated Random() to SecureRandom() (#1670)

* updated Random() to SecureRandom()

* batch 2 of SecureRandom updates
This commit is contained in:
Subhrodip Mohanta
2021-03-06 16:56:02 +05:30
committed by GitHub
parent c150871a94
commit b423002e6c
15 changed files with 32 additions and 31 deletions

View File

@ -23,7 +23,7 @@
package com.iluwatar.leaderfollowers;
import java.util.Random;
import java.security.SecureRandom;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@ -84,7 +84,7 @@ public class App {
* Add tasks.
*/
private static void addTasks(TaskSet taskSet) throws InterruptedException {
var rand = new Random();
var rand = new SecureRandom();
for (var i = 0; i < 5; i++) {
var time = Math.abs(rand.nextInt(1000));
taskSet.addTask(new Task(time));