[
https://issues.apache.org/jira/browse/LANG-1593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kiruahxh updated LANG-1593:
---------------------------
Description:
For now, join(int[], char) is working well.
However, the same join method called with a string delimiter behaves
differently : it returns a single memory addresses which is not the desired
behavior.
I think that, for coherence, calling StringUtils with a char or String
delimiter should return the exact same value.
Ex :
{code:java}
CLASSPATH="./commons-lang3-3.11.jar" jshell
| Welcome to JShell -- Version 11.0.8
jshell> import org.apache.commons.lang3.StringUtils
jshell> int[] arr = {1, 2, 3, 4, 5, 6, 7};
jshell> String result = StringUtils.join(arr, '-');
result ==> "1-2-3-4-5-6-7"
jshell> String result = StringUtils.join(arr, "-");
result ==> "[I@69663380-"
{code}
was:
For now, join(int[], char) is working well.
However, the same join method called with a string delimiter behaves
differently : it returns memory addresses which is rarely the desired behavior.
I think that, for coherence, calling StringUtils with a char or String
delimiter should return the exact same value.
Ex :
{code:java}
CLASSPATH="./commons-lang3-3.4.jar" jshell
| Welcome to JShell -- Version 11.0.8
| For an introduction type: /help intro
jshell> /env -class-path commons-lang3-3.4.jar
| Setting new options and restoring state.
jshell> import org.apache.commons.lang3.StringUtils;jshell>
int[] arr = new int[] {1, 2, 3, 4, 5, 6, 7};
jshell> String result = StringUtils.join(arr, '-');
result ==> "1-2-3-4-5-6-7"
jshell> String result = StringUtils.join(arr, "-");
result ==> "[I@69663380-"
{code}
> Common behaviour for StringUtils join APIs when called with char or String
> delimiter
> ------------------------------------------------------------------------------------
>
> Key: LANG-1593
> URL: https://issues.apache.org/jira/browse/LANG-1593
> Project: Commons Lang
> Issue Type: Improvement
> Affects Versions: 3.4, 3.11
> Reporter: Kiruahxh
> Priority: Minor
>
> For now, join(int[], char) is working well.
> However, the same join method called with a string delimiter behaves
> differently : it returns a single memory addresses which is not the desired
> behavior.
> I think that, for coherence, calling StringUtils with a char or String
> delimiter should return the exact same value.
> Ex :
> {code:java}
> CLASSPATH="./commons-lang3-3.11.jar" jshell
> | Welcome to JShell -- Version 11.0.8
> jshell> import org.apache.commons.lang3.StringUtils
> jshell> int[] arr = {1, 2, 3, 4, 5, 6, 7};
> jshell> String result = StringUtils.join(arr, '-');
> result ==> "1-2-3-4-5-6-7"
> jshell> String result = StringUtils.join(arr, "-");
> result ==> "[I@69663380-"
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)