1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 13:07:59 +01:00

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

View file

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