You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2011/03/16 06:07:29 UTC

[jira] Created: (LANG-687) Convert more of the StringUtils API to take CharSequence

Convert more of the StringUtils API to take CharSequence
--------------------------------------------------------

                 Key: LANG-687
                 URL: https://issues.apache.org/jira/browse/LANG-687
             Project: Commons Lang
          Issue Type: Improvement
          Components: lang.*
            Reporter: Henri Yandell
             Fix For: 3.0


Wherever possible, use CharSequence and not String in the StringUtils API.

substring can go to subSequence inside code. The general substring method can be replaced with a subSequence method and substring deprecated(?). One question is whether to implement a CharSequence.indexOf type method. Given that it's merely a walking method(?!?), this might be quite handy and would allow a bunch of StringUtils methods to move over.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-687:
-------------------------------

    Description: 
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
[SOME] indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase


  was:
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase



svn ci -m "Moving indexOf(String, int) and indexOf(String, int, int) over to CharSequence. LANG-687. This, plus the same happening for the String, String, int variant will open up a lot of methods. "
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
Transmitting file data ..
Committed revision 1082062.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> [DONE] center
> chomp
> chop
> contains
> containsAny
> containsIgnoreCase
> containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> [SOME] indexOf
> indexOfAny
> indexOfAnyBut
> indexOfIgnoreCase
> join
> lastIndexOf
> lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> [DONE] left
> [DONE] leftPad
> [DONE] lowerCase
> [DONE] mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> [DONE] right
> [DONE] rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> [DONE] swapCase
> trim
> trimToEmpty
> trimToNull
> [DONE] upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016268#comment-13016268 ] 

Henri Yandell commented on LANG-687:
------------------------------------

svn ci -m "Moving countMatches, ordinalIndexOf and lastOrdinalIndexOf over to a CharSequence-based API. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Transmitting file data .
Committed revision 1089305.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Use CharSequence and not String in the StringUtils API for non-mutating operations.
> Anything which has to choose between the mutable and immutable nature of CharSequence subclasses (i.e. takes a String and returns a String), should not be changed. Anything that does not mutate the input (even in spirit) should use CharSequence.
> Additionally there should be a unit test that uses reflection to confirm this rule is in place.
> Listing remaining methods to move to CharSequence:
>     public static boolean equalsIgnoreCase(String str1, String str2) {
>     public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int indexOfIgnoreCase(String str, String searchStr) {
>     public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static boolean containsIgnoreCase(String str, String searchStr) {
>     public static int countMatches(String str, String sub) {
>     public static boolean startsWith(String str, String prefix) {
>     public static boolean startsWithIgnoreCase(String str, String prefix) {
>     public static boolean startsWithAny(String string, String... searchStrings) {
>     public static boolean endsWith(String str, String suffix) {
>     public static boolean endsWithIgnoreCase(String str, String suffix) {
>     public static boolean endsWithAny(String string, String... searchStrings) {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016629#comment-13016629 ] 

Henri Yandell commented on LANG-687:
------------------------------------

svn ci -m "Moving equalsIgnoreCase, indexOfIgnoreCase, lastIndexOfIgnoreCase and containsIgnoreCase to the CharSequence API. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Transmitting file data .
Committed revision 1089695.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Use CharSequence and not String in the StringUtils API for non-mutating operations.
> Anything which has to choose between the mutable and immutable nature of CharSequence subclasses (i.e. takes a String and returns a String), should not be changed. Anything that does not mutate the input (even in spirit) should use CharSequence.
> Additionally there should be a unit test that uses reflection to confirm this rule is in place.
> Listing remaining methods to move to CharSequence:
>     public static boolean equalsIgnoreCase(String str1, String str2) {
>     public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int indexOfIgnoreCase(String str, String searchStr) {
>     public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static boolean containsIgnoreCase(String str, String searchStr) {
>     public static int countMatches(String str, String sub) {
>     public static boolean startsWith(String str, String prefix) {
>     public static boolean startsWithIgnoreCase(String str, String prefix) {
>     public static boolean startsWithAny(String string, String... searchStrings) {
>     public static boolean endsWith(String str, String suffix) {
>     public static boolean endsWithIgnoreCase(String str, String suffix) {
>     public static boolean endsWithAny(String string, String... searchStrings) {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-687:
-------------------------------

    Description: 
Use CharSequence and not String in the StringUtils API for non-mutating operations.

Anything which has to choose between the mutable and immutable nature of CharSequence subclasses (i.e. takes a String and returns a String), should not be changed. Anything that does not mutate the input (even in spirit) should use CharSequence.

Additionally there should be a unit test that uses reflection to confirm this rule is in place.

Listing remaining methods to move to CharSequence:

    public static boolean equalsIgnoreCase(String str1, String str2) {
    public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
    public static int indexOfIgnoreCase(String str, String searchStr) {
    public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
    public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
    public static int lastIndexOfIgnoreCase(String str, String searchStr) {
    public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
    public static boolean containsIgnoreCase(String str, String searchStr) {
    public static int countMatches(String str, String sub) {
    public static boolean startsWith(String str, String prefix) {
    public static boolean startsWithIgnoreCase(String str, String prefix) {
    public static boolean startsWithAny(String string, String... searchStrings) {
    public static boolean endsWith(String str, String suffix) {
    public static boolean endsWithIgnoreCase(String str, String suffix) {
    public static boolean endsWithAny(String string, String... searchStrings) {


  was:
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
[DONE] contains
[DONE] containsAny
containsIgnoreCase
[DONE] containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
[DONE] indexOf
[DONE] indexOfAny
[DONE] indexOfAnyBut
indexOfIgnoreCase
join
[DONE] lastIndexOf
[DONE] lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
[DONE] substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase



> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Use CharSequence and not String in the StringUtils API for non-mutating operations.
> Anything which has to choose between the mutable and immutable nature of CharSequence subclasses (i.e. takes a String and returns a String), should not be changed. Anything that does not mutate the input (even in spirit) should use CharSequence.
> Additionally there should be a unit test that uses reflection to confirm this rule is in place.
> Listing remaining methods to move to CharSequence:
>     public static boolean equalsIgnoreCase(String str1, String str2) {
>     public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int indexOfIgnoreCase(String str, String searchStr) {
>     public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static boolean containsIgnoreCase(String str, String searchStr) {
>     public static int countMatches(String str, String sub) {
>     public static boolean startsWith(String str, String prefix) {
>     public static boolean startsWithIgnoreCase(String str, String prefix) {
>     public static boolean startsWithAny(String string, String... searchStrings) {
>     public static boolean endsWith(String str, String suffix) {
>     public static boolean endsWithIgnoreCase(String str, String suffix) {
>     public static boolean endsWithAny(String string, String... searchStrings) {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-687.
------------------------------

    Resolution: Fixed

svn ci -m "Adding a test to enforce the CharSequence vs String contract for StringUtils. LANG-687"
Sending        src/test/java/org/apache/commons/lang3/StringUtilsTest.java
Transmitting file data .
Committed revision 1089742.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Use CharSequence and not String in the StringUtils API for non-mutating operations.
> Anything which has to choose between the mutable and immutable nature of CharSequence subclasses (i.e. takes a String and returns a String), should not be changed. Anything that does not mutate the input (even in spirit) should use CharSequence.
> Additionally there should be a unit test that uses reflection to confirm this rule is in place.
> Listing remaining methods to move to CharSequence:
>     public static boolean equalsIgnoreCase(String str1, String str2) {
>     public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int indexOfIgnoreCase(String str, String searchStr) {
>     public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static boolean containsIgnoreCase(String str, String searchStr) {
>     public static int countMatches(String str, String sub) {
>     public static boolean startsWith(String str, String prefix) {
>     public static boolean startsWithIgnoreCase(String str, String prefix) {
>     public static boolean startsWithAny(String string, String... searchStrings) {
>     public static boolean endsWith(String str, String suffix) {
>     public static boolean endsWithIgnoreCase(String str, String suffix) {
>     public static boolean endsWithAny(String string, String... searchStrings) {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016267#comment-13016267 ] 

Henri Yandell commented on LANG-687:
------------------------------------

Of the remaining methods, 8 are IgnoreCase based. This relies on String.java specific code and we would have to reimplement at least regionMatches on top of the CharSequence API.

Of the other 7, ordinalIndexOf, lastIndexOf and countMatches are easy. startsWith, startsWithAny, endsWith and endsWithAny also use regionMatches.

> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Use CharSequence and not String in the StringUtils API for non-mutating operations.
> Anything which has to choose between the mutable and immutable nature of CharSequence subclasses (i.e. takes a String and returns a String), should not be changed. Anything that does not mutate the input (even in spirit) should use CharSequence.
> Additionally there should be a unit test that uses reflection to confirm this rule is in place.
> Listing remaining methods to move to CharSequence:
>     public static boolean equalsIgnoreCase(String str1, String str2) {
>     public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int indexOfIgnoreCase(String str, String searchStr) {
>     public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static boolean containsIgnoreCase(String str, String searchStr) {
>     public static int countMatches(String str, String sub) {
>     public static boolean startsWith(String str, String prefix) {
>     public static boolean startsWithIgnoreCase(String str, String prefix) {
>     public static boolean startsWithAny(String string, String... searchStrings) {
>     public static boolean endsWith(String str, String suffix) {
>     public static boolean endsWithIgnoreCase(String str, String suffix) {
>     public static boolean endsWithAny(String string, String... searchStrings) {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016261#comment-13016261 ] 

Henri Yandell commented on LANG-687:
------------------------------------

Reopening - some of this will be done per the rule in the comment below.

By 'older', I mean 'previous'. i.e. the code added before the rollback.

svn ci -m "Replacing some of the older code. When performing a mutation operation (even if it's on an immutable by returning a new instance), String should go in and String should come out. When performing a non-mutation operation, CharSequence should be passed in. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
Transmitting file data ..
Committed revision 1089302.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> [DONE] center
> chomp
> chop
> [DONE] contains
> [DONE] containsAny
> containsIgnoreCase
> [DONE] containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> [DONE] indexOf
> [DONE] indexOfAny
> [DONE] indexOfAnyBut
> indexOfIgnoreCase
> join
> [DONE] lastIndexOf
> [DONE] lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> [DONE] left
> [DONE] leftPad
> [DONE] lowerCase
> [DONE] mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> [DONE] right
> [DONE] rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> [DONE] substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> [DONE] swapCase
> trim
> trimToEmpty
> trimToNull
> [DONE] upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell reopened LANG-687:
--------------------------------


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Use CharSequence and not String in the StringUtils API for non-mutating operations.
> Anything which has to choose between the mutable and immutable nature of CharSequence subclasses (i.e. takes a String and returns a String), should not be changed. Anything that does not mutate the input (even in spirit) should use CharSequence.
> Additionally there should be a unit test that uses reflection to confirm this rule is in place.
> Listing remaining methods to move to CharSequence:
>     public static boolean equalsIgnoreCase(String str1, String str2) {
>     public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int indexOfIgnoreCase(String str, String searchStr) {
>     public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static boolean containsIgnoreCase(String str, String searchStr) {
>     public static int countMatches(String str, String sub) {
>     public static boolean startsWith(String str, String prefix) {
>     public static boolean startsWithIgnoreCase(String str, String prefix) {
>     public static boolean startsWithAny(String string, String... searchStrings) {
>     public static boolean endsWith(String str, String suffix) {
>     public static boolean endsWithIgnoreCase(String str, String suffix) {
>     public static boolean endsWithAny(String string, String... searchStrings) {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-687:
-------------------------------

    Description: 
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
[DONE] indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase


  was:
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
[SOME] indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase



> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> [DONE] center
> chomp
> chop
> contains
> containsAny
> containsIgnoreCase
> containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> [DONE] indexOf
> indexOfAny
> indexOfAnyBut
> indexOfIgnoreCase
> join
> lastIndexOf
> lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> [DONE] left
> [DONE] leftPad
> [DONE] lowerCase
> [DONE] mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> [DONE] right
> [DONE] rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> [DONE] swapCase
> trim
> trimToEmpty
> trimToNull
> [DONE] upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Issue Comment Edited: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007360#comment-13007360 ] 

Henri Yandell edited comment on LANG-687 at 3/16/11 6:18 AM:
-------------------------------------------------------------

svn ci -m "Moving indexOf(String, int) and indexOf(String, int, int) over to CharSequence. LANG-687. This, plus the same happening for the String, String, int variant will open up a lot of methods. "
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
Transmitting file data ..
Committed revision 1082062.

svn ci -m "Moving indexOf(String, String) and indexOf(String, String, int) over to CharSequence. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
Transmitting file data ..
Committed revision 1082066.



      was (Author: bayard):
    svn ci -m "Moving indexOf(String, int) and indexOf(String, int, int) over to CharSequence. LANG-687. This, plus the same happening for the String, String, int variant will open up a lot of methods. "
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
Transmitting file data ..
Committed revision 1082062.

  
> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> [DONE] center
> chomp
> chop
> contains
> containsAny
> containsIgnoreCase
> containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> [SOME] indexOf
> indexOfAny
> indexOfAnyBut
> indexOfIgnoreCase
> join
> lastIndexOf
> lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> [DONE] left
> [DONE] leftPad
> [DONE] lowerCase
> [DONE] mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> [DONE] right
> [DONE] rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> [DONE] swapCase
> trim
> trimToEmpty
> trimToNull
> [DONE] upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-687:
-------------------------------

    Description: 
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase


  was:
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. I'll update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase



> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> [DONE] center
> chomp
> chop
> contains
> containsAny
> containsIgnoreCase
> containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> indexOf
> indexOfAny
> indexOfAnyBut
> indexOfIgnoreCase
> join
> lastIndexOf
> lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> [DONE] left
> [DONE] leftPad
> [DONE] lowerCase
> [DONE] mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> [DONE] right
> [DONE] rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> [DONE] swapCase
> trim
> trimToEmpty
> trimToNull
> [DONE] upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-687:
-------------------------------

    Description: 
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of methods that don't take CharSequence. I'll update the description in place to show status.

  was:
Wherever possible, use CharSequence and not String in the StringUtils API.

substring can go to subSequence inside code. The general substring method can be replaced with a subSequence method and substring deprecated(?). One question is whether to implement a CharSequence.indexOf type method. Given that it's merely a walking method(?!?), this might be quite handy and would allow a bunch of StringUtils methods to move over.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of methods that don't take CharSequence. I'll update the description in place to show status.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-687.
------------------------------

    Resolution: Won't Fix

All this code is rolled back - doesn't make sense to do this after discussion on the mailing list.

svn ci -m "Rolling StringUtils and test code back to r1082046. The move to CharSequence is theoretically desirable, but there are no common immutable CharSequence subclasses other than String, making this a complex and useless change. Instead StrBuilder should be enhanced. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
Transmitting file data ..
Committed revision 1088444.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> [DONE] center
> chomp
> chop
> [DONE] contains
> [DONE] containsAny
> containsIgnoreCase
> [DONE] containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> [DONE] indexOf
> [DONE] indexOfAny
> [DONE] indexOfAnyBut
> indexOfIgnoreCase
> join
> [DONE] lastIndexOf
> [DONE] lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> [DONE] left
> [DONE] leftPad
> [DONE] lowerCase
> [DONE] mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> [DONE] right
> [DONE] rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> [DONE] substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> [DONE] swapCase
> trim
> trimToEmpty
> trimToNull
> [DONE] upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007353#comment-13007353 ] 

Henri Yandell commented on LANG-687:
------------------------------------

svn ci -m "Moving abbreviate + abbreviateMiddle to CharSequences"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Transmitting file data .
Committed revision 1082051.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of methods that don't take CharSequence. I'll update the description in place to show status.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-687:
-------------------------------

    Description: 
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. I'll update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase


  was:
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. I'll update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
left
leftPad
lowerCase
mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
right
rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
swapCase
trim
trimToEmpty
trimToNull
upperCase



svn ci -m "Moving center, left, leftPad, right, rightPad, mid, upperCase, lowerCase and swapCase over to CharSequence input. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Transmitting file data .
Committed revision 1082054.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. I'll update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> [DONE] center
> chomp
> chop
> contains
> containsAny
> containsIgnoreCase
> containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> indexOf
> indexOfAny
> indexOfAnyBut
> indexOfIgnoreCase
> join
> lastIndexOf
> lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> [DONE] left
> [DONE] leftPad
> [DONE] lowerCase
> [DONE] mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> [DONE] right
> [DONE] rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> [DONE] swapCase
> trim
> trimToEmpty
> trimToNull
> [DONE] upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-687:
-------------------------------

    Description: 
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
[DONE] contains
[DONE] containsAny
containsIgnoreCase
[DONE] containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
[DONE] indexOf
[DONE] indexOfAny
[DONE] indexOfAnyBut
indexOfIgnoreCase
join
[DONE] lastIndexOf
[DONE] lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
[DONE] substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase


  was:
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
[DONE] center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
[DONE] indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
[DONE] left
[DONE] leftPad
[DONE] lowerCase
[DONE] mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
[DONE] right
[DONE] rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
[DONE] swapCase
trim
trimToEmpty
trimToNull
[DONE] upperCase



svn ci -m "Moving lastIndexOf, contains, containsWhitespace, indexOfAny, containsAny, indexOfAnyBut, containsOnly, containsNone and substring over to using CharSequences for parameters. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
Transmitting file data ..
Committed revision 1082413.

svn ci -m "Moving contains(String, int) over to CharSequence. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Transmitting file data .
Committed revision 1082414.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. Let's update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> [DONE] center
> chomp
> chop
> [DONE] contains
> [DONE] containsAny
> containsIgnoreCase
> [DONE] containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> [DONE] indexOf
> [DONE] indexOfAny
> [DONE] indexOfAnyBut
> indexOfIgnoreCase
> join
> [DONE] lastIndexOf
> [DONE] lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> [DONE] left
> [DONE] leftPad
> [DONE] lowerCase
> [DONE] mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> [DONE] right
> [DONE] rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> [DONE] substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> [DONE] swapCase
> trim
> trimToEmpty
> trimToNull
> [DONE] upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016446#comment-13016446 ] 

Henri Yandell commented on LANG-687:
------------------------------------

svn ci -m "Adding green regionMatches implementation and moving endsWith and startsWith methods to use it; thus giving them CharSequence based APIs. LANG-687"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Transmitting file data .
Committed revision 1089540.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Use CharSequence and not String in the StringUtils API for non-mutating operations.
> Anything which has to choose between the mutable and immutable nature of CharSequence subclasses (i.e. takes a String and returns a String), should not be changed. Anything that does not mutate the input (even in spirit) should use CharSequence.
> Additionally there should be a unit test that uses reflection to confirm this rule is in place.
> Listing remaining methods to move to CharSequence:
>     public static boolean equalsIgnoreCase(String str1, String str2) {
>     public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int indexOfIgnoreCase(String str, String searchStr) {
>     public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr) {
>     public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
>     public static boolean containsIgnoreCase(String str, String searchStr) {
>     public static int countMatches(String str, String sub) {
>     public static boolean startsWith(String str, String prefix) {
>     public static boolean startsWithIgnoreCase(String str, String prefix) {
>     public static boolean startsWithAny(String string, String... searchStrings) {
>     public static boolean endsWith(String str, String suffix) {
>     public static boolean endsWithIgnoreCase(String str, String suffix) {
>     public static boolean endsWithAny(String string, String... searchStrings) {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (LANG-687) Convert more of the StringUtils API to take CharSequence

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-687:
-------------------------------

    Description: 
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of unique method names that don't take CharSequence. I'll update the description in place to show status.

[DONE] abbreviate
[DONE] abbreviateMiddle
center
chomp
chop
contains
containsAny
containsIgnoreCase
containsWhitespace
countMatches
defaultString
deleteWhitespace
difference
endsWith
endsWithAny
endsWithIgnoreCase
equalsIgnoreCase
getCommonPrefix
indexOf
indexOfAny
indexOfAnyBut
indexOfIgnoreCase
join
lastIndexOf
lastIndexOfAny
lastIndexOfIgnoreCase
lastOrdinalIndexOf
left
leftPad
lowerCase
mid
normalizeSpace
ordinalIndexOf
overlay
remove
removeEnd
removeEndIgnoreCase
removeStart
removeStartIgnoreCase
repeat
replace
replaceChars
replaceEach
replaceEachRepeatedly
replaceOnce
reverse
reverseDelimited
right
rightPad
split
splitByCharacterType
splitByCharacterTypeCamelCase
splitByWholeSeparator
splitByWholeSeparatorPreserveAllTokens
splitPreserveAllTokens
startsWith
startsWithAny
startsWithIgnoreCase
strip
stripAll
stripEnd
stripStart
stripToEmpty
stripToNull
substring
substringAfter
substringAfterLast
substringBefore
substringBeforeLast
substringBetween
substringsBetween
swapCase
trim
trimToEmpty
trimToNull
upperCase


  was:
Wherever possible, use CharSequence and not String in the StringUtils API.

Here is the working list of methods that don't take CharSequence. I'll update the description in place to show status.


> Convert more of the StringUtils API to take CharSequence
> --------------------------------------------------------
>
>                 Key: LANG-687
>                 URL: https://issues.apache.org/jira/browse/LANG-687
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Wherever possible, use CharSequence and not String in the StringUtils API.
> Here is the working list of unique method names that don't take CharSequence. I'll update the description in place to show status.
> [DONE] abbreviate
> [DONE] abbreviateMiddle
> center
> chomp
> chop
> contains
> containsAny
> containsIgnoreCase
> containsWhitespace
> countMatches
> defaultString
> deleteWhitespace
> difference
> endsWith
> endsWithAny
> endsWithIgnoreCase
> equalsIgnoreCase
> getCommonPrefix
> indexOf
> indexOfAny
> indexOfAnyBut
> indexOfIgnoreCase
> join
> lastIndexOf
> lastIndexOfAny
> lastIndexOfIgnoreCase
> lastOrdinalIndexOf
> left
> leftPad
> lowerCase
> mid
> normalizeSpace
> ordinalIndexOf
> overlay
> remove
> removeEnd
> removeEndIgnoreCase
> removeStart
> removeStartIgnoreCase
> repeat
> replace
> replaceChars
> replaceEach
> replaceEachRepeatedly
> replaceOnce
> reverse
> reverseDelimited
> right
> rightPad
> split
> splitByCharacterType
> splitByCharacterTypeCamelCase
> splitByWholeSeparator
> splitByWholeSeparatorPreserveAllTokens
> splitPreserveAllTokens
> startsWith
> startsWithAny
> startsWithIgnoreCase
> strip
> stripAll
> stripEnd
> stripStart
> stripToEmpty
> stripToNull
> substring
> substringAfter
> substringAfterLast
> substringBefore
> substringBeforeLast
> substringBetween
> substringsBetween
> swapCase
> trim
> trimToEmpty
> trimToNull
> upperCase

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira