commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [1/5] [lang] Clarify behavior of containsAny for null entries in the supplied CharSequence array
Date Thu, 07 May 2015 15:56:29 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master d864bbfb8 -> 7a2b1c1c3


Clarify behavior of containsAny for null entries in the supplied CharSequence array


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/adc6bc41
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/adc6bc41
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/adc6bc41

Branch: refs/heads/master
Commit: adc6bc4104514063b3e8ebe7a301d5dd4bce36d3
Parents: d864bbf
Author: Benedikt Ritter <britter@apache.org>
Authored: Thu May 7 17:47:20 2015 +0200
Committer: Benedikt Ritter <britter@apache.org>
Committed: Thu May 7 17:47:20 2015 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/lang3/StringUtils.java            | 1 +
 .../org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java     | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/adc6bc41/src/main/java/org/apache/commons/lang3/StringUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 617361e..fcd924c 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -1684,6 +1684,7 @@ public class StringUtils {
      * StringUtils.containsAny(*, null)            = false
      * StringUtils.containsAny(*, [])              = false
      * StringUtils.containsAny("abcd", "ab", "cd") = false
+     * StringUtils.containsAny("abcd", "ab", null) = false
      * StringUtils.containsAny("abc", "d", "abc")  = true
      * </pre>
      *

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/adc6bc41/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
index 1a1f37a..edf1e7a 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
@@ -226,6 +226,8 @@ public class StringUtilsEqualsIndexOfTest  {
         assertTrue(StringUtils.containsAny("hello, goodbye", new String[] { "hello", "goodbye"
}));
         assertTrue(StringUtils.containsAny("hello, goodbye", new String[] { "hello", "Goodbye"
}));
         assertFalse(StringUtils.containsAny("hello, goodbye", new String[] { "Hello", "Goodbye"
}));
+        assertFalse(StringUtils.containsAny("hello, goodbye", new String[] { "Hello", null
}));
+        assertFalse(StringUtils.containsAny("hello, null", new String[] { "Hello", null }));
     }
 
     @Test


Mime
View raw message