Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 42280 invoked from network); 19 Feb 2004 21:14:20 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 19 Feb 2004 21:14:20 -0000 Received: (qmail 6296 invoked by uid 500); 19 Feb 2004 21:14:06 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 6262 invoked by uid 500); 19 Feb 2004 21:14:06 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 6248 invoked by uid 500); 19 Feb 2004 21:14:06 -0000 Received: (qmail 6242 invoked from network); 19 Feb 2004 21:14:05 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 19 Feb 2004 21:14:05 -0000 Received: (qmail 42258 invoked by uid 1818); 19 Feb 2004 21:14:16 -0000 Date: 19 Feb 2004 21:14:16 -0000 Message-ID: <20040219211416.42257.qmail@minotaur.apache.org> From: mbenson@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant WHATSNEW X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mbenson 2004/02/19 13:14:16 Modified: src/testcases/org/apache/tools/ant/filters TokenFilterTest.java src/main/org/apache/tools/ant/filters TokenFilter.java src/etc/testcases/filters tokenfilter.xml . WHATSNEW Log: TokenFilter.ReplaceString only replaced the first occurrence. Revision Changes Path 1.7 +8 -0 ant/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java Index: TokenFilterTest.java =================================================================== RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TokenFilterTest.java 9 Feb 2004 21:05:41 -0000 1.6 +++ TokenFilterTest.java 19 Feb 2004 21:14:16 -0000 1.7 @@ -82,6 +82,10 @@ "this is the moon"); } + public void testReplaceStrings() throws IOException { + expectLogContaining("replacestrings", "bar bar bar"); + } + public void testContainsString() throws IOException { String contents = getFileString( "containsstring", "result/containsstring"); @@ -137,6 +141,10 @@ String contents = getFileString( "filterreplacestring", "result/filterreplacestring"); assertStringContains(contents, "This is the moon"); + } + + public void testFilterReplaceStrings() throws IOException { + expectLogContaining("filterreplacestrings", "bar bar bar"); } public void testContainsRegex() throws IOException { 1.16 +1 -1 ant/src/main/org/apache/tools/ant/filters/TokenFilter.java Index: TokenFilter.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/TokenFilter.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- TokenFilter.java 9 Feb 2004 21:05:17 -0000 1.15 +++ TokenFilter.java 19 Feb 2004 21:14:16 -0000 1.16 @@ -527,7 +527,7 @@ // search again start = found + from.length(); - found = line.indexOf(line, start); + found = line.indexOf(from, start); } // write the remaining characters 1.4 +20 -0 ant/src/etc/testcases/filters/tokenfilter.xml Index: tokenfilter.xml =================================================================== RCS file: /home/cvs/ant/src/etc/testcases/filters/tokenfilter.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- tokenfilter.xml 28 May 2003 15:31:07 -0000 1.3 +++ tokenfilter.xml 19 Feb 2004 21:14:16 -0000 1.4 @@ -67,6 +67,15 @@ + + + foo foo foo + + + + + + This is a number @@ -129,6 +138,17 @@ + + + + + + + + foo foo foo + + + 1.547 +2 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.546 retrieving revision 1.547 diff -u -r1.546 -r1.547 --- WHATSNEW 19 Feb 2004 11:01:20 -0000 1.546 +++ WHATSNEW 19 Feb 2004 21:14:16 -0000 1.547 @@ -21,6 +21,8 @@ * macrodef @@ escaping was broken. Bugzilla Report 27069. +* replacestring tokenfilter only replaced the first occurrence. + Other changes: -------------- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org