JoaoJandre commented on code in PR #7134:
URL: https://github.com/apache/cloudstack/pull/7134#discussion_r1091030700


##########
utils/src/main/java/com/cloud/utils/PasswordGenerator.java:
##########
@@ -41,6 +41,8 @@ public class PasswordGenerator {
     static private char[] alphaNumeric = new char[] {'A', 'B', 'C', 'D', 'E', 
'F', 'G', 'H', 'J', 'K', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 
'X', 'Y',
         'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '2', '3', '4', '5', '6', '7', 
'8', '9'};
 
+    static private char[] symbols = new char[] {'!', '#', '@', '(', '%', '^', 
'&', '*', '$', ')', '-', '_', '+', '=', '{', '}', '[', ']', '|', '\\', ':', 
';', '"', '\'', '<', '>', '.', '?'};

Review Comment:
   You could make this variable protected, and use it in your 
`containsSpecialChar` test in the `PasswordGeneratorTest` class, this way you 
don't need to create a new string with all these symbols.
   Furthermore if any new special symbol is added here, the test will cover it 
automatically as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to