Skip to content
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

Replace StringBuffer with StringBuilder #1756

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

stratozero
Copy link

StringBuffer is a synchronized Appendable, useful when more than one publisher is appending text to the same Appendable, but a waste of resources when the object is created and consumed by the same method (e.g. various toString()).

Furthermore, in Java 21+ synchronization interferes with the pinning of virtual threads on the carrier thread, potentially slowing down the application if, while locking an object, a suspendable operation is performed (e.g. IO read / write or Thread.sleep())

mormao-zg and others added 24 commits July 23, 2024 16:14
…ngBuilder / StringJoiner / string-composition
…ngBuilder / StringJoiner / string-composition
…ngBuilder / StringJoiner / string-composition
…ngBuilder / StringJoiner / string-composition. Make loop variables "final" to leverage compiler bytecode inlining
…ngBuilder / StringJoiner / string-composition. Make loop variables "final" to leverage compiler bytecode inlining
…ngBuilder / StringJoiner / string-composition.
…ngJoiner with prefix "[", suffix "]" and separator ", "
…string by System's file separator, as it can lead to StringIndexOutOfBoundException in case the test folder does not exist
…string by System's file separator, as it can lead to StringIndexOutOfBoundException in case the test folder does not exist
Correct bad syntax
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.

2 participants