GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Prefer StringBuilder for local variables by elharo · Pull Request #368 · apache/maven-shared-utils

Conversation

@elharo

@elharo elharo commented Feb 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

since they don't need synchronization

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@elharo
Prefer StringBuilder for local variables
7a5a21b
@elharo
elharo requested a review from Copilot February 4, 2026 12:42
Copilot started reviewing on behalf of elharo February 4, 2026 12:43
View session
Copilot AI reviewed Feb 4, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR converts local StringBuffer variables to StringBuilder for better performance, since local variables don't require the thread-safety overhead of StringBuffer's synchronized methods.

Changes:

  • Changed StringBuffer to StringBuilder in XmlWriterUtil's writeComment method
  • Changed StringBuffer to StringBuilder in StringUtils' uncapitalise method
  • Changed StringBuffer to StringBuilder in StringUtils' reverse method

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main/java/org/apache/maven/shared/utils/xml/XmlWriterUtil.java Converted local StringBuffer variable to StringBuilder in the writeComment method
src/main/java/org/apache/maven/shared/utils/StringUtils.java Converted local StringBuffer instances to StringBuilder in uncapitalise and reverse methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@elharo

elharo commented Feb 4, 2026

Copy link
Copy Markdown
Contributor Author

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.apache.maven.shared:maven-shared-utils:3.4.3-SNAPSHOT: The following artifacts could not be resolved: org.apache.maven.shared:maven-shared-components:pom:47 (absent): Could not transfer artifact org.apache.maven.shared:maven-shared-components:pom:47 from/to central (https://repo.maven.apache.org/maven2): PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed and 'parent.relativePath' points at wrong local POM @ line 23, column 11
@

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@elharo
StringBuilder
518430a
@elharo
elharo marked this pull request as ready for review February 4, 2026 22:46
@elharo
elharo requested a review from slachiewicz February 4, 2026 22:46
slachiewicz
slachiewicz approved these changes Feb 6, 2026
View reviewed changes
@elharo elharo added the maintenance label Feb 6, 2026
@elharo
elharo merged commit 3fba762 into master Feb 6, 2026
14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@elharo
elharo deleted the buf branch February 6, 2026 21:16
@github-actions github-actions Bot assigned elharo Feb 6, 2026
@github-actions github-actions Bot added this to the 3.5.0 milestone Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@slachiewicz slachiewicz slachiewicz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@elharo elharo

Labels

maintenance

Projects

None yet

Milestone

3.5.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@elharo @slachiewicz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.