You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Will Pugh (JIRA)" <ji...@apache.org> on 2006/07/03 22:59:29 UTC

[jira] Created: (LANG-268) StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)

StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)
-----------------------------------------------------------------------------------------------

         Key: LANG-268
         URL: http://issues.apache.org/jira/browse/LANG-268
     Project: Commons Lang
        Type: Improvement

    Reporter: Will Pugh
 Attachments: addRangeToJoin.patch

Currently join, takes an array of objects, adn joins them using a character or string as a separator.

The problem is that there are many instances where I have an array, but I only want to join part of it.  There are various split, etc. I can use to get this to work, but the problem is that they are all inefficient and more work than I think I should have to do.

I've attached a patch that introduces two new methods to do what I am requesting (one for the string case, one for the character case), as well as additions to the unit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (LANG-268) StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LANG-268?page=comments#action_12438779 ] 
            
Henri Yandell commented on LANG-268:
------------------------------------

I'm thinking that if someone passes in a startIndex that is greater than the endIndex, that we should throw an IllegalArgumentException.

> StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)
> -----------------------------------------------------------------------------------------------
>
>                 Key: LANG-268
>                 URL: http://issues.apache.org/jira/browse/LANG-268
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Will Pugh
>             Fix For: 2.3
>
>         Attachments: addRangeToJoin.patch
>
>
> Currently join, takes an array of objects, adn joins them using a character or string as a separator.
> The problem is that there are many instances where I have an array, but I only want to join part of it.  There are various split, etc. I can use to get this to work, but the problem is that they are all inefficient and more work than I think I should have to do.
> I've attached a patch that introduces two new methods to do what I am requesting (one for the string case, one for the character case), as well as additions to the unit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (LANG-268) StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)

Posted by "Will Pugh (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LANG-268?page=all ]

Will Pugh updated LANG-268:
---------------------------

    Attachment: addRangeToJoin.patch

A patch with the new methods as well as new unit tests

> StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)
> -----------------------------------------------------------------------------------------------
>
>          Key: LANG-268
>          URL: http://issues.apache.org/jira/browse/LANG-268
>      Project: Commons Lang
>         Type: Improvement

>     Reporter: Will Pugh
>  Attachments: addRangeToJoin.patch
>
> Currently join, takes an array of objects, adn joins them using a character or string as a separator.
> The problem is that there are many instances where I have an array, but I only want to join part of it.  There are various split, etc. I can use to get this to work, but the problem is that they are all inefficient and more work than I think I should have to do.
> I've attached a patch that introduces two new methods to do what I am requesting (one for the string case, one for the character case), as well as additions to the unit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (LANG-268) StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LANG-268?page=all ]

Henri Yandell updated LANG-268:
-------------------------------

    Fix Version: 2.3

Modifies existing code, so I think it should be flagged for 2.3 inclusion rather than the upcoming 2.2. 

I'm +1 on the methods.

> StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)
> -----------------------------------------------------------------------------------------------
>
>          Key: LANG-268
>          URL: http://issues.apache.org/jira/browse/LANG-268
>      Project: Commons Lang
>         Type: Improvement

>     Reporter: Will Pugh
>      Fix For: 2.3
>  Attachments: addRangeToJoin.patch
>
> Currently join, takes an array of objects, adn joins them using a character or string as a separator.
> The problem is that there are many instances where I have an array, but I only want to join part of it.  There are various split, etc. I can use to get this to work, but the problem is that they are all inefficient and more work than I think I should have to do.
> I've attached a patch that introduces two new methods to do what I am requesting (one for the string case, one for the character case), as well as additions to the unit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (LANG-268) StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LANG-268?page=all ]

Henri Yandell resolved LANG-268.
--------------------------------

    Resolution: Fixed

svn ci -m "Applying patch from Will Pugh in #LANG-268 - Addition of new variants of the join method. "

Sending        src/java/org/apache/commons/lang/StringUtils.java
Sending        src/test/org/apache/commons/lang/StringUtilsTest.java
Transmitting file data ..
Committed revision 451394.

> StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)
> -----------------------------------------------------------------------------------------------
>
>                 Key: LANG-268
>                 URL: http://issues.apache.org/jira/browse/LANG-268
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Will Pugh
>             Fix For: 2.3
>
>         Attachments: addRangeToJoin.patch
>
>
> Currently join, takes an array of objects, adn joins them using a character or string as a separator.
> The problem is that there are many instances where I have an array, but I only want to join part of it.  There are various split, etc. I can use to get this to work, but the problem is that they are all inefficient and more work than I think I should have to do.
> I've attached a patch that introduces two new methods to do what I am requesting (one for the string case, one for the character case), as well as additions to the unit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (LANG-268) StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LANG-268?page=comments#action_12438780 ] 
            
Henri Yandell commented on LANG-268:
------------------------------------

Cancel that - looks like substring returns "" when that happens.

> StringUtils.join should allow you to pass a range for it (so it only joins a part of the array)
> -----------------------------------------------------------------------------------------------
>
>                 Key: LANG-268
>                 URL: http://issues.apache.org/jira/browse/LANG-268
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Will Pugh
>             Fix For: 2.3
>
>         Attachments: addRangeToJoin.patch
>
>
> Currently join, takes an array of objects, adn joins them using a character or string as a separator.
> The problem is that there are many instances where I have an array, but I only want to join part of it.  There are various split, etc. I can use to get this to work, but the problem is that they are all inefficient and more work than I think I should have to do.
> I've attached a patch that introduces two new methods to do what I am requesting (one for the string case, one for the character case), as well as additions to the unit tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org