Skip to content

Replaced StringBuffer with StringBuilder in WcCommand.java:251#537

Closed
opencode-agent[bot] wants to merge 1 commit into
masterfrom
opencode/issue532-20260619202914
Closed

Replaced StringBuffer with StringBuilder in WcCommand.java:251#537
opencode-agent[bot] wants to merge 1 commit into
masterfrom
opencode/issue532-20260619202914

Conversation

@opencode-agent

Copy link
Copy Markdown

Done. Replaced StringBuffer with StringBuilder in the print method at line 251 of WcCommand.java. This is a local, single-threaded context so StringBuilder avoids unnecessary synchronization overhead.

Closes #532

New%20session%20-%202026-06-19T20%3A29%3A13.691Z
opencode session  |  github run

Co-authored-by: LSantha <LSantha@users.noreply.github.com>
@LSantha

LSantha commented Jun 19, 2026

Copy link
Copy Markdown
Owner

/oc review

@opencode-agent

Copy link
Copy Markdown
Author

The change is correct. StringBuilder is the appropriate choice here since:

  1. The print method is called from printLineprintResultsexecute - all single-threaded
  2. No shared buffer or thread-safety concerns exist
  3. StringBuilder avoids unnecessary synchronization overhead

No other StringBuffer usages exist in this file. The change is minimal, localized, and improves performance. LGTM.

New%20session%20-%202026-06-19T20%3A34%3A28.685Z
opencode session  |  github run

@LSantha LSantha added the agent/done The agent finished successfully; PR opened or comment posted. label Jun 19, 2026
@LSantha

LSantha commented Jun 19, 2026

Copy link
Copy Markdown
Owner

/oc review

@opencode-agent

Copy link
Copy Markdown
Author

The change is correct. Line 251 now uses StringBuilder instead of StringBuffer:

StringBuilder sValue = new StringBuilder(paddingSize + 1);

Analysis:

  • The print method (line 250-261) is called from printLineprintResultsexecute - all single-threaded command execution
  • No shared buffer or thread-safety concerns exist
  • StringBuilder avoids unnecessary synchronization overhead

The change is minimal, localized, and improves performance. LGTM.

New%20session%20-%202026-06-19T20%3A37%3A44.421Z
opencode session  |  github run

@LSantha

LSantha commented Jun 19, 2026

Copy link
Copy Markdown
Owner

/oc review

@opencode-agent

Copy link
Copy Markdown
Author

The change is correct. Line 251 now uses StringBuilder instead of StringBuffer:

StringBuilder sValue = new StringBuilder(paddingSize + 1);

Analysis:

  • The print method (lines 250-261) is called from printLineprintResultsexecute - all single-threaded command execution
  • No shared buffer or thread-safety concerns exist
  • StringBuilder avoids unnecessary synchronization overhead

The change is minimal, localized, and improves performance. LGTM.

New%20session%20-%202026-06-19T20%3A40%3A32.899Z
opencode session  |  github run

@LSantha

LSantha commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Superseded by #541, which already merged the same WcCommand StringBuilder change into master.

@LSantha LSantha closed this Jun 20, 2026
@LSantha LSantha deleted the opencode/issue532-20260619202914 branch June 20, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/done The agent finished successfully; PR opened or comment posted.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace StringBuffer with StringBuilder in cli WcCommand

1 participant