geniusjoe commented on code in PR #23577:
URL: https://github.com/apache/pulsar/pull/23577#discussion_r1856748372


##########
pulsar-client/src/main/java/org/apache/pulsar/client/util/NameUtil.java:
##########
@@ -21,7 +21,7 @@
 import java.util.UUID;
 import org.apache.commons.codec.digest.DigestUtils;
 
-public class ConsumerName {
+public class NameUtil {
     public static String generateRandomName() {
         return DigestUtils.sha1Hex(UUID.randomUUID().toString()).substring(0, 
5);
     }

Review Comment:
   > Now I see the reason of renaming the class, [#23577 
(comment)](https://github.com/apache/pulsar/pull/23577#discussion_r1846456815) 
. I'd suggest removing this class completely in a follow up PR and using 
Commons Lang3's `org.apache.commons.lang3.RandomStringUtils#randomAscii(int)` 
method with the parameter `5` to create a random string of 5 characters. 
@geniusjoe Would you like to submit a PR for that?
   
   @lhotari  Thank you for reviewing my pr. This `generateRandomName()` only 
use in just few cases and I think it's better to use `randomAscii()` you 
mentioned to replace this class. I'm glad to submit a new PR ASAP.
   
   



-- 
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