gemmellr commented on code in PR #5487:
URL: https://github.com/apache/activemq-artemis/pull/5487#discussion_r1952847054


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/RandomUtil.java:
##########
@@ -31,17 +31,56 @@ public static Random getRandom() {
       return random;
    }
 
+   private static String letters = "abcdefghijklmnopqrstuvwxyz";
+
+   private static String digits = "0123456789";
+
+   private static String randomBase = letters + letters.toUpperCase() + digits;
+
+   /**
+    * Utility method to build a {@code String} filled with random 
alpha-numeric characters. The {@code String} will
+    * contain characters from the following:
+    * <ul>
+    *    <li>abcdefghijklmnopqrstuvwxyz</li>
+    *    <li>ABCDEFGHIJKLMNOPQRSTUVWXYZ</li>
+    *    <li>0123456789</li>
+    * </ul>
+    * @param length how long the returned {@code String} should be
+    * @return a {@code String} of random alpha-numeric characters
+    */
+   public static String randomAlphaNumericString(int length) {
+      StringBuilder result = new StringBuilder(length);
+      for (int i = 0; i < length; i++) {
+         result.append(randomBase.charAt(randomInterval(0, 
randomBase.length())));

Review Comment:
   I added another commit, 
https://github.com/apache/activemq-artemis/pull/5487/commits/c95e69cee1e6f678bb32f9c6f4f912e13ded2d7b,
 making the change and a couple others nearby. See what you think.
   
   If you are ok with the change we can squash it into your earlier commit for 
that Jira and then merge this (I already ran the full test suite on it).



-- 
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: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to