You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/07/30 17:21:27 UTC

[GitHub] [rocketmq] gorden5566 opened a new issue #3203: Replace the class 'StringBuffer' by 'StringBuilder'

gorden5566 opened a new issue #3203:
URL: https://github.com/apache/rocketmq/issues/3203


   The issue tracker is **ONLY** used for bug report(feature request need to follow [RIP process](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal)). Keep in mind, please check whether there is an existing same report before your raise a new one.
   
   Alternately (especially if your communication is not a bug report), you can send mail to our [mailing lists](http://rocketmq.apache.org/about/contact/). We welcome any friendly suggestions, bug fixes, collaboration and other improvements.
   
   Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as the following:
   
   We use 'StringBuffer' to concat 'String' in some methods. For example, in the `Message#setKeys` method, 'StringBuffer' was used to concat 'keys'
   
   ```
   public void setKeys(Collection<String> keys) {
       StringBuffer sb = new StringBuffer();
       for (String k : keys) {
           sb.append(k);
           sb.append(MessageConst.KEY_SEPARATOR);
       }
   
       this.setKeys(sb.toString().trim());
   }
   ```
   The 'StringBuffer' has a negative impact on performance due to synchronized. 
   Because of this, I think that we can use 'StringBuilder' to replace 'StringBuffer'
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] odbozhou commented on issue #3203: Replace the class 'StringBuffer' by 'StringBuilder'

Posted by GitBox <gi...@apache.org>.
odbozhou commented on issue #3203:
URL: https://github.com/apache/rocketmq/issues/3203#issuecomment-892387748


   merged


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] odbozhou closed issue #3203: Replace the class 'StringBuffer' by 'StringBuilder'

Posted by GitBox <gi...@apache.org>.
odbozhou closed issue #3203:
URL: https://github.com/apache/rocketmq/issues/3203


   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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