You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by eduardomartins-luizalabs <gi...@git.apache.org> on 2015/05/05 20:39:24 UTC

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

GitHub user eduardomartins-luizalabs opened a pull request:

    https://github.com/apache/commons-lang/pull/81

    DOC: StringUtils.containsAny. ADD: containsAllWords to StringUtils

    Checks if the String contains all words.
    ```java
    StringUtils.containsAllWords("lorem ipsum dolor sit amet", "ipsum", "lorem", "dolor") == true
    StringUtils.containsAllWords("lorem ipsum dolor sit amet", "ipsum", null, "lorem", "dolor") == false
    StringUtils.containsAllWords("ab", "b") == false
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/eduardomartins-luizalabs/commons-lang master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/81.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #81
    
----
commit 6ee22b46f5e0d8ae48e79be486a603513fbbaa10
Author: Eduardo Martins <ed...@luizalabs.com>
Date:   2015-05-05T18:32:46Z

    FIX: Javadoc issue on StringUtils.containsAny. ADD: containsAllWords to StringUtils

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by britter <gi...@git.apache.org>.
Github user britter commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99186498
  
    Usually we make additional commit so that the development of a feature can be tracked afterwards. Since in this case the commit would change the whole PR, I think amending is appropriate in this case. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by eduardomartins-luizalabs <gi...@git.apache.org>.
Github user eduardomartins-luizalabs commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99198225
  
    @britter updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by eduardomartins-luizalabs <gi...@git.apache.org>.
Github user eduardomartins-luizalabs commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99187699
  
    Ok


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by eduardomartins-luizalabs <gi...@git.apache.org>.
Github user eduardomartins-luizalabs commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99940742
  
    Sorry about the JIRA card.
    I think it's a great improvement, i will do that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99202424
  
    
    [![Coverage Status](https://coveralls.io/builds/2493010/badge)](https://coveralls.io/builds/2493010)
    
    Coverage increased (+0.01%) to 93.36% when pulling **54facb4fd93c2ff59b3096c6e64b9be1b3c9cd88 on eduardomartins-luizalabs:master** into **d6dd2b4cd4a337c5517952680c3714e5d08e9cb8 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by eduardomartins-luizalabs <gi...@git.apache.org>.
Github user eduardomartins-luizalabs commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99185054
  
    @britter i didn't saw this class, my bad.
    Should I send another commit or amend this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by britter <gi...@git.apache.org>.
Github user britter commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99921440
  
    Hello @eduardomartins-luizalabs,
    
    the following will fail:
    
    ```java
    assertFalse(WordUtils.containsAllWords("lorem ipsum null dolor sit amet", "ipsum", null, "lorem", "dolor"));
    ```
    
    This is because you only check for nulls at index 0 of the input array. IMHO null is not contained in any string. Have a look at for example ```StringUtils.containsAny(CharSequence, CharSequence...)``` and adc6bc4104514063b3e8ebe7a301d5dd4bce36d3. Further more I wonder whether we should let this method operate on CharSequences. WDYT?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by britter <gi...@git.apache.org>.
Github user britter commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99912803
  
    Your placeholder Jira issue is https://issues.apache.org/jira/browse/LANG-1135. Please create a Jira for bigger contributions as documented in CONTRIBUTING.md. Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1135 - Add method containsAllWords...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-lang/pull/81


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by britter <gi...@git.apache.org>.
Github user britter commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99181116
  
    This would better fit into ```org.apache.commons.lang3.text.WordUtils```, because it deals with words. I could imagine having a StringUtils.containsAll(CharSequence, CharSequence...) method that just checks if all of the given CharSequences are all contained in the first CharSequence, but without handling word boundaries.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99207396
  
    
    [![Coverage Status](https://coveralls.io/builds/2493019/badge)](https://coveralls.io/builds/2493019)
    
    Coverage increased (+0.01%) to 93.36% when pulling **54facb4fd93c2ff59b3096c6e64b9be1b3c9cd88 on eduardomartins-luizalabs:master** into **d6dd2b4cd4a337c5517952680c3714e5d08e9cb8 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1135 - Add method containsAllWords...

Posted by eduardomartins-luizalabs <gi...@git.apache.org>.
Github user eduardomartins-luizalabs commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99942769
  
    @britter updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by agrava-luizalabs <gi...@git.apache.org>.
Github user agrava-luizalabs commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/81#discussion_r29700273
  
    --- Diff: src/main/java/org/apache/commons/lang3/StringUtils.java ---
    @@ -1685,7 +1685,7 @@ public static boolean containsAny(final CharSequence cs, final CharSequence sear
          * StringUtils.containsAny("", *)              = false
          * StringUtils.containsAny(*, null)            = false
          * StringUtils.containsAny(*, [])              = false
    -     * StringUtils.containsAny("abcd", "ab", "cd") = false
    +     * StringUtils.containsAny("abcd", "ab", "cd") = true
    --- End diff --
    
    It is good to point out that the documentation was wrong in this case


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99201966
  
    
    [![Coverage Status](https://coveralls.io/builds/2492985/badge)](https://coveralls.io/builds/2492985)
    
    Coverage increased (+0.0%) to 93.35% when pulling **54facb4fd93c2ff59b3096c6e64b9be1b3c9cd88 on eduardomartins-luizalabs:master** into **d6dd2b4cd4a337c5517952680c3714e5d08e9cb8 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the pull request:

    https://github.com/apache/commons-lang/pull/81#issuecomment-99202623
  
    
    [![Coverage Status](https://coveralls.io/builds/2493014/badge)](https://coveralls.io/builds/2493014)
    
    Coverage decreased (-0.0%) to 93.35% when pulling **54facb4fd93c2ff59b3096c6e64b9be1b3c9cd88 on eduardomartins-luizalabs:master** into **d6dd2b4cd4a337c5517952680c3714e5d08e9cb8 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: DOC: StringUtils.containsAny. ADD: cont...

Posted by eduardomartins-luizalabs <gi...@git.apache.org>.
Github user eduardomartins-luizalabs commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/81#discussion_r29704041
  
    --- Diff: src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java ---
    @@ -16,21 +16,16 @@
      */
     package org.apache.commons.lang3;
     
    -import static org.junit.Assert.assertEquals;
    -import static org.junit.Assert.assertFalse;
    -import static org.junit.Assert.assertThat;
    -import static org.junit.Assert.assertTrue;
    -
    -import java.util.Locale;
    -
     import org.apache.commons.lang3.test.DefaultLocale;
     import org.hamcrest.core.IsNot;
     import org.junit.Test;
     
    +import java.util.Locale;
    --- End diff --
    
    Sorry about that, Ide issue.
    I will fix.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---