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

This commit is contained in:
Benedikt Ritter 2015-05-07 17:47:20 +02:00
parent d864bbfb8f
commit adc6bc4104
2 changed files with 3 additions and 0 deletions

View File

@ -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>
*

View File

@ -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