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

* updated Random() to SecureRandom()

* batch 2 of SecureRandom updates
This commit is contained in:
Subhrodip Mohanta authored and GitHub committed 2021-03-06 13:26:02 +02:00
1 parent c150871a94
commit b423002e6c
15 files changed
+32 -31

No files matched your search

@@ -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));