Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A3ACB6509 for ; Wed, 27 Jul 2011 05:48:22 +0000 (UTC) Received: (qmail 67380 invoked by uid 500); 27 Jul 2011 05:43:47 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 67007 invoked by uid 500); 27 Jul 2011 05:43:37 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 66585 invoked by uid 99); 27 Jul 2011 05:43:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 05:43:33 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 05:43:32 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 1CA548B9FE for ; Wed, 27 Jul 2011 05:43:12 +0000 (UTC) Date: Wed, 27 Jul 2011 05:43:12 +0000 (UTC) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Message-ID: <2001735974.10797.1311745392113.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1344198695.10581.1299763259485.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LANG-686) StringUtils.replaceEachRepeatedly("aaa", new String[]{"aa"}, new String[]{"aXa"}); throw an exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13071526#comment-13071526 ] Henri Yandell commented on LANG-686: ------------------------------------ Digging into this, the search should have been: "aaa" "aXaa" "aXaXa" Which is hardly the deepest loop. The TTL would have been 1, ie) the length of the inputted String[] { "aXa" }. I wonder if the issue is that TTL needs to be longer (which is what qed did by adding extra ""s). > StringUtils.replaceEachRepeatedly("aaa", new String[]{"aa"}, new String[]{"aXa"}); throw an exception > ----------------------------------------------------------------------------------------------------- > > Key: LANG-686 > URL: https://issues.apache.org/jira/browse/LANG-686 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 2.6 > Environment: jdk 1.6.24, windows xp pro sp3, eclipse helios > Reporter: qed > Fix For: 3.0.1 > > > After executing line > StringUtils.replaceEachRepeatedly("aaa", new String[]{"aa"}, new String[]{"aXa"}); > exception is thrown: > Exception in thread "main" java.lang.IllegalStateException: TimeToLive of -1 is less than 0: aXaXa > at org.apache.commons.lang.StringUtils.replaceEach(StringUtils.java:3986) > at org.apache.commons.lang.StringUtils.replaceEach(StringUtils.java:4099) > at org.apache.commons.lang.StringUtils.replaceEach(StringUtils.java:4099) > at org.apache.commons.lang.StringUtils.replaceEachRepeatedly(StringUtils.java:3920) -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira