Return-Path: Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 73653 invoked by uid 500); 19 Jul 2003 14:29:41 -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 73642 invoked by uid 500); 19 Jul 2003 14:29:41 -0000 Received: (qmail 73638 invoked from network); 19 Jul 2003 14:29:41 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 19 Jul 2003 14:29:41 -0000 Received: (qmail 89331 invoked by uid 1652); 19 Jul 2003 14:29:40 -0000 Date: 19 Jul 2003 14:29:40 -0000 Message-ID: <20030719142940.89330.qmail@icarus.apache.org> From: antoine@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/i18n Translate.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N antoine 2003/07/19 07:29:40 Modified: src/etc/testcases/taskdefs/optional/i18n/translate/input template.txt src/main/org/apache/tools/ant/taskdefs/optional/i18n Translate.java Log: Add a line ending at the end of the file used for unit test Fix the code of Translate.java to preserve line endings Revision Changes Path 1.2 +1 -1 ant/src/etc/testcases/taskdefs/optional/i18n/translate/input/template.txt Index: template.txt =================================================================== RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/optional/i18n/translate/input/template.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- template.txt 30 Jun 2003 10:41:00 -0000 1.1 +++ template.txt 19 Jul 2003 14:29:40 -0000 1.2 @@ -1 +1 @@ -@This@ @is@ @a@ @demo@ @file@ @for@ @the@ translate@_task@. \ No newline at end of file +@This@ @is@ @a@ @demo@ @file@ @for@ @the@ translate@_task@. 1.28 +6 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java Index: Translate.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- Translate.java 19 Jul 2003 11:20:18 -0000 1.27 +++ Translate.java 19 Jul 2003 14:29:40 -0000 1.28 @@ -67,6 +67,7 @@ import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; +import org.apache.tools.ant.filters.TokenFilter; import org.apache.tools.ant.taskdefs.MatchingTask; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.util.FileUtils; @@ -517,7 +518,10 @@ BufferedReader in = new BufferedReader(new InputStreamReader(fis, srcEncoding)); String line; - while ((line = in.readLine()) != null) { + TokenFilter.LineTokenizer lineTokenizer = new TokenFilter.LineTokenizer(); + lineTokenizer.setIncludeDelims(true); + line = lineTokenizer.getToken(in); + while ((line) != null) { // 2003-02-21 new replace algorithm by tbee (tbee@tbee.org) // because it wasn't able to replace something like "@aaa;@bbb;" @@ -579,7 +583,7 @@ out.write(line); - out.newLine(); + line = lineTokenizer.getToken(in); } if (in != null) { in.close(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org