You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/11/17 03:27:35 UTC

[GitHub] [pulsar] Jason918 commented on a change in pull request #12837: Remove werid assign value in DefaultMessageFormatter

Jason918 commented on a change in pull request #12837:
URL: https://github.com/apache/pulsar/pull/12837#discussion_r750853678



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/testclient/DefaultMessageFormatter.java
##########
@@ -81,21 +81,18 @@ private float _getFloatValue(float size) {
 
     private String getStringValue(float size) {
         int s = (int) size;
-        if (size == 0) {

Review comment:
       It seems that it's a default size for error situation.
   Maybe it's better not change it if you are absolute sure?

##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/testclient/DefaultMessageFormatter.java
##########
@@ -81,21 +81,18 @@ private float _getFloatValue(float size) {
 
     private String getStringValue(float size) {
         int s = (int) size;
-        if (size == 0) {
-            size = 20;
-        };
-        String result = "";
+        StringBuilder result = new StringBuilder();
         for(int i = 0; i < s; i++) {

Review comment:
       `org.apache.commons.lang3.RandomStringUtils#randomAlphabetic(int)` can be used to generate random string.




-- 
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: commits-unsubscribe@pulsar.apache.org

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