ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/i18n Translate.java
Date Sat, 19 Jul 2003 14:29:40 GMT
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


Mime
View raw message