Skip to content

Replace StringBuffer with StringBuilder in AntScript#2268

Merged
laeubi merged 1 commit intoeclipse-pde:masterfrom
laeubi:fix/stringbuffer-to-stringbuilder-antscript
Mar 24, 2026
Merged

Replace StringBuffer with StringBuilder in AntScript#2268
laeubi merged 1 commit intoeclipse-pde:masterfrom
laeubi:fix/stringbuffer-to-stringbuilder-antscript

Conversation

@laeubi
Copy link
Contributor

@laeubi laeubi commented Mar 23, 2026

Replace the synchronized StringBuffer with StringBuilder in AntScript.getEscaped() and the private helper appendEscapedChar().

The local variable is not shared across threads, so StringBuilder is the appropriate choice and avoids unnecessary synchronization overhead.

@github-actions
Copy link

github-actions bot commented Mar 23, 2026

Test Results

  147 files  ±0    147 suites  ±0   36m 17s ⏱️ -57s
3 495 tests ±0  3 441 ✅ ±0   54 💤 ±0  0 ❌ ±0 
9 306 runs  ±0  9 176 ✅ ±0  130 💤 ±0  0 ❌ ±0 

Results for commit 70984fb. ± Comparison against base commit cb4a95a.

♻️ This comment has been updated with latest results.

StringBuffer is synchronized and thus slower than StringBuilder.
The local variable in getEscaped() is not shared across threads,
so StringBuilder is the appropriate choice here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@laeubi laeubi force-pushed the fix/stringbuffer-to-stringbuilder-antscript branch from ddeedef to 70984fb Compare March 23, 2026 13:57
@laeubi laeubi merged commit 86cdd31 into eclipse-pde:master Mar 24, 2026
18 of 19 checks passed
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