GeezerVison is showing github.com — Prefer StringBuilder for local variables by elharo · Pull Request #368 · apache/maven-shared-utils
Conversation
elharo
commented
Feb 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
since they don't need synchronization
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
|
[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
@
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.