updated Random() to SecureRandom() (#1670)
* updated Random() to SecureRandom() * batch 2 of SecureRandom updates
This commit is contained in:
committed by
GitHub
parent
c150871a94
commit
b423002e6c
@ -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));
|
||||
|
Reference in New Issue
Block a user