Do not hardcode the char[] length in StringUtils

This commit is contained in:
Florian Schmaus 2014-07-07 00:03:11 +02:00
parent 8b16c49a31
commit e469601468
1 changed files with 1 additions and 1 deletions

View File

@ -261,7 +261,7 @@ public class StringUtils {
// Create a char buffer to put random letters and numbers in.
char [] randBuffer = new char[length];
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);
}