Skip to content

AMQ-9732: More Code cleanup: use StringBuilder instead of StringBuffer #1461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grigoni
Copy link
Contributor

@grigoni grigoni commented Jun 14, 2025

second round about StringBuffer usage

  1. use StringBuilder instead of StringBuffer: this avoids unnecessary sync
  2. use StringBuilder best practice when concatenating
  3. avoid concatenation in logging
  4. use java.nio.charset.StandardCharsets for getBytes
  5. use isEmpty() instead of ...length() > 0
  6. use "0123456789".repeat(Math.max(0, loopSize)); instead of a loop with a SB
  7. some typos fixing

see https://issues.apache.org/jira/browse/AMQ-9732

use StringBuilder best practice when concatenating
avoid concatenation in logging
some typo fixing
@jbonofre jbonofre self-requested a review June 14, 2025 15:17
@grigoni grigoni changed the title More Code cleanup: use StringBuilder instead of StringBuffer AMQ-9732: More Code cleanup: use StringBuilder instead of StringBuffer Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant