You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sven Schliesing (JIRA)" <ji...@apache.org> on 2008/06/10 11:57:45 UTC

[jira] Created: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

Method "startsWithAny(String str, String[] searchStrs)"
-------------------------------------------------------

                 Key: LANG-445
                 URL: https://issues.apache.org/jira/browse/LANG-445
             Project: Commons Lang
          Issue Type: New Feature
            Reporter: Sven Schliesing
            Priority: Minor


Similar to 
http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])

To replace
----------
if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
----------
with
----------
if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Sven Schliesing updated LANG-445:
---------------------------------

    Attachment: commons-lang-startsWithAny.patch.txt

See commons-lang-startsWithAny.patch.txt for patch. I tried to not violate the style conventions. This is my first contribution to commons-lang, so please be gentle if I did. :)

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Sven Schliesing
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: commons-lang-startsWithAny.patch.txt
>
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Sven Schliesing updated LANG-445:
---------------------------------

    Attachment: commons-lang-startsWithAny2.patch.txt

commons-lang-startsWithAny2: using StringUtils.startsWith() to be more null-safe

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Sven Schliesing
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: commons-lang-startsWithAny.patch.txt, commons-lang-startsWithAny2.patch.txt
>
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Sebb commented on LANG-445:
---------------------------

Added commons-lang-startsWithAny2 to SVN trunk:

URL: http://svn.apache.org/viewvc?rev=697715&view=rev
Log:
LANG-445 - new method StringUtils.startsWithAny(String str, String[] searchStrs)

Modified:
   commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java
   commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringUtilsTest.java

Had to fix a Javadoc bug - parameter is called searchStrings, not searchString.
Also added another False test to ensure all the substrings are checked.

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Sven Schliesing
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: commons-lang-startsWithAny.patch.txt, commons-lang-startsWithAny2.patch.txt
>
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Gary Gregory commented on LANG-445:
-----------------------------------

Are you really stuck on Java 1.3? Even though we have not moved to 1.4 yet, doesn't it seem odd to add methods for functionality are available through regular expressions? 

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Sven Schliesing
>            Priority: Minor
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Sven Schliesing commented on LANG-445:
--------------------------------------

Shouldn't this be marked as resolved?

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Sven Schliesing
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: commons-lang-startsWithAny.patch.txt, commons-lang-startsWithAny2.patch.txt
>
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Niall Pemberton updated LANG-445:
---------------------------------

    Fix Version/s:     (was: 3.0)
                   2.5

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>            Reporter: Sven Schliesing
>            Priority: Minor
>             Fix For: 2.5
>
>         Attachments: commons-lang-startsWithAny.patch.txt, commons-lang-startsWithAny2.patch.txt
>
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Henri Yandell updated LANG-445:
-------------------------------

    Fix Version/s: 3.0

Assigning to 3.0, but move to 3.x if no patch shows up.

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Sven Schliesing
>            Priority: Minor
>             Fix For: 3.0
>
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Sven Schliesing commented on LANG-445:
--------------------------------------

I'm not stuck on 1.3. In fact I'm using 1.6. 

But I don't understand your argument "available through regular expressions". I think there are plenty of methods in commons-lang that you could replace with regexp. Like startsWith(), just to name one.

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Sven Schliesing
>            Priority: Minor
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LANG-445) Method "startsWithAny(String str, String[] searchStrs)"

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

Sebb closed LANG-445.
---------------------

    Resolution: Fixed

> Method "startsWithAny(String str, String[] searchStrs)"
> -------------------------------------------------------
>
>                 Key: LANG-445
>                 URL: https://issues.apache.org/jira/browse/LANG-445
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Sven Schliesing
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: commons-lang-startsWithAny.patch.txt, commons-lang-startsWithAny2.patch.txt
>
>
> Similar to 
> http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#indexOfAny(java.lang.String,%20java.lang.String[])
> To replace
> ----------
> if (StringUtils.startsWith(foo, "bar") || StringUtils.startsWith(foo, "baz") || ...) [...]
> ----------
> with
> ----------
> if (StringUtils.startsWithAny(foo, new String[] {"bar", "baz", ...})) [...]
> ----------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.