mirror of https://github.com/apache/poi.git
[github-278] Resolve all SpotBugs P1 issues in Main and Test. Thanks to Andreas Reichel. This closes #278
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895017 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8365ee1611
commit
2ebe1aa650
|
@ -0,0 +1,19 @@
|
||||||
|
package org.apache.poi.util;
|
||||||
|
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
|
||||||
|
/*
|
||||||
|
If it is important that the generated Random numbers not be guessable,
|
||||||
|
you MUST NOT create a new Random for each random number; the values are too easily guessable.
|
||||||
|
|
||||||
|
You should strongly consider using a java.security.SecureRandom instead
|
||||||
|
(and avoid allocating a new SecureRandom for each random number needed).
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class RandomSingleton {
|
||||||
|
private static final SecureRandom INSTANCE = new SecureRandom();
|
||||||
|
|
||||||
|
public static SecureRandom getInstance() {
|
||||||
|
return INSTANCE;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue