AMQ-9732: More Code cleanup: use StringBuilder instead of StringBuffer
second round about StringBuffer usage
- use StringBuilder instead of StringBuffer: this avoids unnecessary sync
- use StringBuilder best practice when concatenating
- avoid concatenation in logging
- use
java.nio.charset.StandardCharsetsfor getBytes - use isEmpty() instead of
...length() > 0 - use
"0123456789".repeat(Math.max(0, loopSize));instead of a loop with a SB - some typos fixing
see https://issues.apache.org/jira/browse/AMQ-9732
hello @jbonofre , @cshannon my intention with this PR was to complete StringBuffer cleanup started with AMQ-9720 do you have a chance to review it? thx
@grigoni yes I started to review it. Generally speaking, I'm not a big fan of large PR for code cleanup (when generated by tool or not). It's long to review (it touches different part of the code) and side effects can happen (for instance, using a not expected locale, ...).
So, instead of a super large PR changing everything at once, I would split into smaller chuncks.
That said for this PR, at first glance, it looks good, but I still have to do a new pass.
@jbonofre fully agree about large PR, if you prefer I'll split/remove some parts
@grigoni it's ok. Don't worry. I will do a pass.
Breaking up the commits by type of fix and maven module is helpful in the event something need to be reverted.