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 — Deprecate StringUtils.concatenate in favor of JDK String.join by elharo · Pull Request #361 · apache/maven-shared-utils

Conversation

@elharo

@elharo elharo commented Feb 1, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

fixes #347

Sorry, something went wrong.

Uh oh!

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

All reactions
@elharo
Deprecate StringUtils.concatenate
283ac1c
@elharo
elharo requested a review from Copilot February 1, 2026 13:16
Copilot started reviewing on behalf of elharo February 1, 2026 13:17
View session
Copilot AI reviewed Feb 1, 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 deprecates the StringUtils.concatenate() method and suggests using Java's built-in String.join() method as a replacement. However, there is a discrepancy between the PR description (which references issue #349 about deprecating StringUtils.clean) and the actual changes (which deprecate StringUtils.concatenate).

Changes:

  • Added @Deprecated annotation to the concatenate(Object... array) method
  • Added @deprecated javadoc tag suggesting String.join() as replacement

💡 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
Comment thread src/main/java/org/apache/maven/shared/utils/StringUtils.java Outdated
*
* @param array the array of values to concatenate.
* @return the concatenated string.
* @deprecated use <code>java.lang.String.join(</code>) instead

Copilot AI Feb 1, 2026

Copy link

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.

The deprecation message has a malformed HTML code tag. The opening parenthesis is inside the code tag but the closing parenthesis is outside it, making it read as "java.lang.String.join(" followed by ") instead". Based on other deprecation patterns in this file (lines 210, 460, 475, 502, 574, 605), the message should either be:

  • "use {@code java.lang.String.join()}" (using {@code} format without tags)
  • "use java.lang.String.join()" (with both parentheses inside the tag)

The current format with the unmatched parenthesis is inconsistent and will not render correctly in generated documentation.

Sorry, something went wrong.

Uh oh!

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

All reactions
Copilot uses AI. Check for mistakes.
Comment thread src/main/java/org/apache/maven/shared/utils/StringUtils.java Outdated
*
* @param array the array of values to concatenate.
* @return the concatenated string.
* @deprecated use <code>java.lang.String.join(</code>) instead

Copilot AI Feb 1, 2026

Copy link

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.

The suggested replacement with String.join() is potentially misleading. The StringUtils.concatenate() method accepts Object[] (varargs) and calls toString() on each element, while String.join() requires CharSequence elements. This means String.join() is not a drop-in replacement for cases where non-CharSequence objects are passed.

Consider clarifying the deprecation message to indicate that elements should be converted to strings first, or suggest using a stream-based approach like: Arrays.stream(array).map(Object::toString).collect(Collectors.joining(""))

This is particularly important since the method signature explicitly accepts Object... array, suggesting it was designed to handle non-string objects.

Sorry, something went wrong.

Uh oh!

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

All reactions
Copilot uses AI. Check for mistakes.
elharo added 2 commits February 1, 2026 08:04
@elharo
javadoc
ae25617
@elharo
javadoc
32dc417
@apache apache deleted a comment from Copilot AI Feb 1, 2026
slachiewicz
slachiewicz approved these changes Feb 1, 2026
View reviewed changes
elharo added 3 commits February 1, 2026 15:00
@elharo
merge
3f799a1
@elharo
spotless
88606b3
@elharo
nonnull
625c830
@elharo
elharo merged commit e950e2c into master Feb 2, 2026
14 checks passed

Uh oh!

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

@elharo
elharo deleted the concat branch February 2, 2026 02:04
@github-actions github-actions Bot added this to the 3.5.0 milestone Feb 2, 2026
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown

@elharo Please assign appropriate label to PR according to the type of change.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot assigned elharo Feb 2, 2026
@elharo elharo added the deprecated Pull requests that deprecate features label Feb 2, 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

deprecated Pull requests that deprecate features

Projects

None yet

Milestone

3.5.0

Development

Successfully merging this pull request may close these issues.

Deprecate StringUtils.concatenate

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.