RobertIndie commented on a change in pull request #12837:
URL: https://github.com/apache/pulsar/pull/12837#discussion_r751201923
##########
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 the `size` is not used later. It looks like the intent of
this method is to generate the random string of default size 20 when 0 is
passed in. I think the value here should be assigned to the `s` instead of the
`size`.
##########
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:
I agree.
--
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]