GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — Deprecate StringUtils.concatenate in favor of JDK String.join by elharo · Pull Request #361 · apache/maven-shared-utils Conversation
|
| * | ||
| * @param array the array of values to concatenate. | ||
| * @return the concatenated string. | ||
| * @deprecated use <code>java.lang.String.join(</code>) instead |
There was a problem 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:
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.
There was an error while loading. Please reload this page.
| * | ||
| * @param array the array of values to concatenate. | ||
| * @return the concatenated string. | ||
| * @deprecated use <code>java.lang.String.join(</code>) instead |
There was a problem 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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@elharo Please assign appropriate label to PR according to the type of change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Deprecate StringUtils.concatenate
There was an error while loading. Please reload this page.