mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Change all "java.util.Random" to "java.security.SecureRandom"
This commit is contained in:
parent
f3f22e803a
commit
e1a9d3a5f6
4 changed files with 8 additions and 9 deletions
|
|
@ -40,7 +40,7 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ public class IPythonClient {
|
|||
private final IPythonGrpc.IPythonBlockingStub blockingStub;
|
||||
private final IPythonGrpc.IPythonStub asyncStub;
|
||||
|
||||
private Random random = new Random();
|
||||
private SecureRandom random = new SecureRandom();
|
||||
|
||||
/**
|
||||
* Construct client for accessing RouteGuide server at {@code host:port}.
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
|
|
@ -70,7 +70,7 @@ public class InterpreterGroup {
|
|||
}
|
||||
|
||||
private static String generateId() {
|
||||
return "InterpreterGroup_" + System.currentTimeMillis() + "_" + new Random().nextInt();
|
||||
return "InterpreterGroup_" + System.currentTimeMillis() + "_" + new SecureRandom().nextInt();
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ package org.apache.zeppelin.util;
|
|||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
/**
|
||||
* Generate Tiny ID.
|
||||
|
|
@ -71,6 +71,6 @@ public class IdHashes {
|
|||
}
|
||||
|
||||
public static String generateId() {
|
||||
return encode(System.currentTimeMillis() + new Random().nextInt());
|
||||
return encode(System.currentTimeMillis() + new SecureRandom().nextInt());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import java.util.LinkedHashMap;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
|
@ -139,8 +139,7 @@ public class Paragraph extends Job implements Cloneable, JsonSerializable {
|
|||
}
|
||||
|
||||
private static String generateId() {
|
||||
return "paragraph_" + System.currentTimeMillis() + "_" + new Random(System.currentTimeMillis())
|
||||
.nextInt();
|
||||
return "paragraph_" + System.currentTimeMillis() + "_" + new SecureRandom().nextInt();
|
||||
}
|
||||
|
||||
public Map<String, Paragraph> getUserParagraphMap() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue