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,8 +23,8 @@
|
||||
|
||||
package com.iluwatar.event.asynchronous;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
@ -43,7 +43,7 @@ public class EventManager implements ThreadCompleteListener {
|
||||
public static final int MAX_ID = MAX_RUNNING_EVENTS;
|
||||
public static final int MAX_EVENT_TIME = 1800; // in seconds / 30 minutes.
|
||||
private int currentlyRunningSyncEvent = -1;
|
||||
private final Random rand;
|
||||
private final SecureRandom rand;
|
||||
private final Map<Integer, Event> eventPool;
|
||||
|
||||
private static final String DOES_NOT_EXIST = " does not exist.";
|
||||
@ -52,7 +52,7 @@ public class EventManager implements ThreadCompleteListener {
|
||||
* EventManager constructor.
|
||||
*/
|
||||
public EventManager() {
|
||||
rand = new Random(1);
|
||||
rand = new SecureRandom();
|
||||
eventPool = new ConcurrentHashMap<Integer, Event>(MAX_RUNNING_EVENTS);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user