Commit 367947f3 authored by Costin Grigoras's avatar Costin Grigoras
Browse files

SpotBugs: reuse the Random object between calls

parent 2104e739
......@@ -639,12 +639,13 @@ public class JAKeyStore {
private static final String charString = "!0123456789abcdefghijklmnopqrstuvwxyz@#$%^&*()-+=_{}[]:;|?/>.,<";
private static final Random ran = new Random(System.nanoTime());
/**
* @return randomized char array of passLength length
*/
public static char[] getRandomString() {
final Random ran = new Random(System.nanoTime());
final StringBuffer s = new StringBuffer();
final StringBuffer s = new StringBuffer(passLength);
for (int i = 0; i < passLength; i++) {
final int pos = ran.nextInt(charString.length());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment