mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-25 03:57:58 +01:00
Do not hardcode the char[] length in StringUtils
This commit is contained in:
parent
8b16c49a31
commit
e469601468
1 changed files with 1 additions and 1 deletions
|
@ -261,7 +261,7 @@ public class StringUtils {
|
||||||
// Create a char buffer to put random letters and numbers in.
|
// Create a char buffer to put random letters and numbers in.
|
||||||
char [] randBuffer = new char[length];
|
char [] randBuffer = new char[length];
|
||||||
for (int i=0; i<randBuffer.length; i++) {
|
for (int i=0; i<randBuffer.length; i++) {
|
||||||
randBuffer[i] = numbersAndLetters[randGen.nextInt(71)];
|
randBuffer[i] = numbersAndLetters[randGen.nextInt(numbersAndLetters.length)];
|
||||||
}
|
}
|
||||||
return new String(randBuffer);
|
return new String(randBuffer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue