antoine 2003/06/26 08:21:13 Modified: . WHATSNEW src/main/org/apache/tools/ant/util FileUtils.java Log: Make filtersets preserve line endings Revision Changes Path 1.448 +2 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.447 retrieving revision 1.448 diff -u -r1.447 -r1.448 --- WHATSNEW 24 Jun 2003 16:07:24 -0000 1.447 +++ WHATSNEW 26 Jun 2003 15:21:13 -0000 1.448 @@ -44,6 +44,8 @@ * Filter readers were not handling line endings properly. Bugzilla Report 18476. +* Filtersets were also not handling line endings properly. + * Expand tasks did not behave as expected with PatternSets. * <property environment=... /> now works on OS/400. 1.45 +8 -9 ant/src/main/org/apache/tools/ant/util/FileUtils.java Index: FileUtils.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- FileUtils.java 25 Jun 2003 10:31:45 -0000 1.44 +++ FileUtils.java 26 Jun 2003 15:21:13 -0000 1.45 @@ -80,6 +80,7 @@ import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.filters.util.ChainReaderHelper; +import org.apache.tools.ant.filters.TokenFilter; import org.apache.tools.ant.taskdefs.condition.Os; import org.apache.tools.ant.types.FilterSetCollection; @@ -432,21 +433,19 @@ in = new BufferedReader(rdr); } + TokenFilter.LineTokenizer lineTokenizer = new TokenFilter.LineTokenizer(); + lineTokenizer.setIncludeDelims(true); String newline = null; - String line = in.readLine(); + String line = lineTokenizer.getToken(in); while (line != null) { if (line.length() == 0) { + // this should not happen, because the lines are returned with the end of line delimiter out.newLine(); } else { - if (filterSetsAvailable) { - newline = filters.replaceTokens(line); - } else { - newline = line; - } + newline = filters.replaceTokens(line); out.write(newline); - out.newLine(); } - line = in.readLine(); + line = lineTokenizer.getToken(in); } } finally { if (out != null) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]