You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by ptemplier <gi...@git.apache.org> on 2016/09/23 22:51:46 UTC

[GitHub] commons-lang pull request #193: Add isAnyNotEmpty() and isAnyNotBlank() to S...

GitHub user ptemplier opened a pull request:

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

    Add isAnyNotEmpty() and isAnyNotBlank() to StringUtils

    

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

    $ git pull https://github.com/ptemplier/commons-lang stringutils-new-methods

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

    https://github.com/apache/commons-lang/pull/193.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 #193
    
----
commit d2871a486271d60d49a557bc1f1d296f5efccf97
Author: Pierre Templier <pi...@gmail.com>
Date:   2016-09-23T22:49:32Z

    Add isAnyNotEmpty() and isAnyNotBlank() 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 issue #193: Add isAnyNotEmpty() and isAnyNotBlank() to StringUt...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/193
  
    Thanks! :+1: 


---
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 issue #193: Add isAnyNotEmpty() and isAnyNotBlank() to StringUt...

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

    https://github.com/apache/commons-lang/pull/193
  
    
    [![Coverage Status](https://coveralls.io/builds/8035004/badge)](https://coveralls.io/builds/8035004)
    
    Coverage increased (+0.03%) to 93.557% when pulling **96810e2fd2d2558989f006e35cb0cf0c3ac127ce on ptemplier:stringutils-new-methods** into **db6f7c1d74ba64211221a69cfa9fe7171a9199e8 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 #193: Add isAnyNotEmpty() and isAnyNotBlank() to S...

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

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


---
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 #193: Add isAnyNotEmpty() and isAnyNotBlank() to S...

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

    https://github.com/apache/commons-lang/pull/193#discussion_r80358287
  
    --- Diff: src/main/java/org/apache/commons/lang3/StringUtils.java ---
    @@ -258,6 +258,35 @@ public static boolean isAnyEmpty(final CharSequence... css) {
         }
         
         /**
    +     * <p>Checks if any one of the CharSequences are not empty ("") or null.</p>
    +     *
    +     * <pre>
    +     * StringUtils.isAnyNotEmpty(null)             = false
    +     * StringUtils.isAnyNotEmpty(null, "foo")      = true
    +     * StringUtils.isAnyNotEmpty("", "bar")        = true
    +     * StringUtils.isAnyNotEmpty("bob", "")        = true
    +     * StringUtils.isAnyNotEmpty("  bob  ", null)  = true
    +     * StringUtils.isAnyNotEmpty(" ", "bar")       = true
    +     * StringUtils.isAnyNotEmpty("foo", "bar")     = true
    +     * </pre>
    +     *
    +     * @param css  the CharSequences to check, may be null or empty
    +     * @return {@code true} if any of the CharSequences are empty or null
    +     * @since 3.5
    +     */
    +    public static boolean isAnyNotEmpty(final CharSequence... css) {
    +      if (ArrayUtils.isEmpty(css)) {
    +        return true;
    --- End diff --
    
    I took the same behaviour as isAnyBlank()/isAnyEmpty() but maybe those should return false too. It would make more sense.


---
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 issue #193: Add isAnyNotEmpty() and isAnyNotBlank() to StringUt...

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

    https://github.com/apache/commons-lang/pull/193
  
    
    [![Coverage Status](https://coveralls.io/builds/8031415/badge)](https://coveralls.io/builds/8031415)
    
    Coverage decreased (-0.002%) to 93.527% when pulling **d2871a486271d60d49a557bc1f1d296f5efccf97 on ptemplier:stringutils-new-methods** into **db6f7c1d74ba64211221a69cfa9fe7171a9199e8 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 issue #193: Add isAnyNotEmpty() and isAnyNotBlank() to StringUt...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/193
  
    I agree with both of you.
    
    An empty array does not contain any non-empty/non-blank `CharSequence`s, so `isAnyNotEmpty`/`isAnyNotBlank` should return `false` for an empty array.
    
    An empty array does not contain any empty/blank `CharSequence`s, so `isAnyEmpty`/`isAnyBlank` should return `false` for an empty array.
    
    I created two jira issues: one for the addition: https://issues.apache.org/jira/browse/LANG-1270 and one the purposed change: https://issues.apache.org/jira/browse/LANG-1271 


---
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 #193: Add isAnyNotEmpty() and isAnyNotBlank() to S...

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

    https://github.com/apache/commons-lang/pull/193#discussion_r80357934
  
    --- Diff: src/main/java/org/apache/commons/lang3/StringUtils.java ---
    @@ -358,6 +387,36 @@ public static boolean isAnyBlank(final CharSequence... css) {
         }
         
         /**
    +     * <p>Checks if any one of the CharSequences are not blank ("") or null and not whitespace only..</p>
    +     *
    +     * <pre>
    +     * StringUtils.isAnyNotBlank(null)             = false
    +     * StringUtils.isAnyNotBlank(null, "foo")      = true
    +     * StringUtils.isAnyNotBlank(null, null)       = false
    +     * StringUtils.isAnyNotBlank("", "bar")        = true
    +     * StringUtils.isAnyNotBlank("bob", "")        = true
    +     * StringUtils.isAnyNotBlank("  bob  ", null)  = true
    +     * StringUtils.isAnyNotBlank(" ", "bar")       = true
    +     * StringUtils.isAnyNotBlank("foo", "bar")     = false
    +     * </pre>
    +     *
    +     * @param css  the CharSequences to check, may be null or empty
    +     * @return {@code true} if any of the CharSequences are not blank or null or whitespace only
    +     * @since 3.5
    +     */
    +    public static boolean isAnyNotBlank(final CharSequence... css) {
    +      if (ArrayUtils.isEmpty(css)) {
    +        return true;
    --- End diff --
    
    See above


---
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 #193: Add isAnyNotEmpty() and isAnyNotBlank() to S...

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

    https://github.com/apache/commons-lang/pull/193#discussion_r80357925
  
    --- Diff: src/main/java/org/apache/commons/lang3/StringUtils.java ---
    @@ -258,6 +258,35 @@ public static boolean isAnyEmpty(final CharSequence... css) {
         }
         
         /**
    +     * <p>Checks if any one of the CharSequences are not empty ("") or null.</p>
    +     *
    +     * <pre>
    +     * StringUtils.isAnyNotEmpty(null)             = false
    +     * StringUtils.isAnyNotEmpty(null, "foo")      = true
    +     * StringUtils.isAnyNotEmpty("", "bar")        = true
    +     * StringUtils.isAnyNotEmpty("bob", "")        = true
    +     * StringUtils.isAnyNotEmpty("  bob  ", null)  = true
    +     * StringUtils.isAnyNotEmpty(" ", "bar")       = true
    +     * StringUtils.isAnyNotEmpty("foo", "bar")     = true
    +     * </pre>
    +     *
    +     * @param css  the CharSequences to check, may be null or empty
    +     * @return {@code true} if any of the CharSequences are empty or null
    +     * @since 3.5
    +     */
    +    public static boolean isAnyNotEmpty(final CharSequence... css) {
    +      if (ArrayUtils.isEmpty(css)) {
    +        return true;
    --- End diff --
    
    Shouldn't this return false? An empty Array does not contain any non empty 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 issue #193: Add isAnyNotEmpty() and isAnyNotBlank() to StringUt...

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

    https://github.com/apache/commons-lang/pull/193
  
    
    [![Coverage Status](https://coveralls.io/builds/8035022/badge)](https://coveralls.io/builds/8035022)
    
    Coverage increased (+0.02%) to 93.546% when pulling **03ba8cbe17128556539598112eb8d1dfbe665f1b on ptemplier:stringutils-new-methods** into **cac7a60abf0a4451a5c80ef57343a14ea1ba443f 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.
---