[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:
PJ Fanning 2021-11-14 10:30:59 +00:00
parent 8365ee1611
commit 2ebe1aa650
1 changed files with 19 additions and 0 deletions

View File

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