[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Work logged] (LANG-1593) Common behaviour for StringUtils join APIs when called with char or
From:       "ASF GitHub Bot (Jira)" <jira () apache ! org>
Date:       2021-08-31 14:47:01
Message-ID: JIRA.13320617.1596444190000.951939.1630421221037 () Atlassian ! JIRA
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/LANG-1593?focusedWorklogId=644091&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-644091 \
]

ASF GitHub Bot logged work on LANG-1593:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Aug/21 14:46
            Start Date: 31/Aug/21 14:46
    Worklog Time Spent: 10m 
      Work Description: garydgregory commented on a change in pull request #784:
URL: https://github.com/apache/commons-lang/pull/784#discussion_r699367138



##########
File path: src/test/java/org/apache/commons/lang3/StringUtilsTest.java
##########
@@ -1226,6 +1241,8 @@ public void testJoin_ArrayOfShorts() {
         assertNull(StringUtils.join((short[]) null, SEPARATOR_CHAR, 0, 1));
         assertEquals(StringUtils.EMPTY, StringUtils.join(SHORT_PRIM_LIST, \
                SEPARATOR_CHAR, 0, 0));
         assertEquals(StringUtils.EMPTY, StringUtils.join(SHORT_PRIM_LIST, \
SEPARATOR_CHAR, 1, 0)); +        assertEquals("1,2", \
StringUtils.join(SHORT_PRIM_LIST, SEPARATOR));

Review comment:
       @HubertWo 
   The point of String vs char separators is that a String can be longer than one \
character, so you should test for String separators longer than one character to make \
sure the right work takes place under the covers.  




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 644091)
    Time Spent: 5h 40m  (was: 5.5h)

> 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
> Time Spent: 5h 40m
> Remaining Estimate: 0h
> 
> 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 address 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)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic