Added a the fix for bug #14883.

Submitted-by: Thomas Hawtin [tackline@tackline.demon.co.uk]


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137168 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2002-11-27 22:54:29 +00:00
parent 8846220cf5
commit f682f4b0f0
1 changed files with 4 additions and 1 deletions

View File

@ -73,7 +73,7 @@
* @author <a href="mailto:rand_mcneely@yahoo.com">Rand McNeely</a> * @author <a href="mailto:rand_mcneely@yahoo.com">Rand McNeely</a>
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a> * @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @author <a href="mailto:fredrik@westermarck.com">Fredrik Westermarck</a> * @author <a href="mailto:fredrik@westermarck.com">Fredrik Westermarck</a>
* @version $Id: StringUtils.java,v 1.26 2002/11/23 00:54:24 bayard Exp $ * @version $Id: StringUtils.java,v 1.27 2002/11/27 22:54:29 bayard Exp $
*/ */
public class StringUtils { public class StringUtils {
@ -1398,6 +1398,9 @@ public static String getNestedString(String str, String open, String close) {
* @throws NullPointerException if sub is <code>null</code> * @throws NullPointerException if sub is <code>null</code>
*/ */
public static int countMatches(String str, String sub) { public static int countMatches(String str, String sub) {
if (sub.equals("")) {
return 0;
}
if (str == null) { if (str == null) {
return 0; return 0;
} }