Improving error message when recursion fails TTL in replaceEachRepeatedly. LANG-686

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1151345 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2011-07-27 06:02:06 +00:00
parent 64dd0a070b
commit a7fe1f5018
1 changed files with 2 additions and 1 deletions

View File

@ -4028,7 +4028,8 @@ private static String replaceEach(
// if recursing, this shouldn't be less than 0
if (timeToLive < 0) {
throw new IllegalStateException("TimeToLive of " + timeToLive + " is less than 0: " + text);
throw new IllegalStateException("Output of one loop is the input of another; " +
"protecting from potential StackOverflowError");
}
int searchLength = searchList.length;