diff --git a/src/java/org/apache/commons/lang/StringUtils.java b/src/java/org/apache/commons/lang/StringUtils.java
index d461960dd..546912bfd 100644
--- a/src/java/org/apache/commons/lang/StringUtils.java
+++ b/src/java/org/apache/commons/lang/StringUtils.java
@@ -73,7 +73,7 @@ import java.util.Iterator;
* @author Rand McNeely
* @author Stephen Colebourne
* @author Fredrik Westermarck
- * @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 {
@@ -1398,6 +1398,9 @@ public class StringUtils {
* @throws NullPointerException if sub is null
*/
public static int countMatches(String str, String sub) {
+ if (sub.equals("")) {
+ return 0;
+ }
if (str == null) {
return 0;
}