You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by mb...@apache.org on 2005/03/03 23:16:11 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs FixCRLF.java

mbenson     2005/03/03 14:16:11

  Modified:    src/main/org/apache/tools/ant/taskdefs FixCRLF.java
  Log:
  Remove empty default constructor;
  create the filterchain Vector only once per Object.
  
  Revision  Changes    Path
  1.67      +8 -15     ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
  
  Index: FixCRLF.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- FixCRLF.java	3 Mar 2005 21:46:47 -0000	1.66
  +++ FixCRLF.java	3 Mar 2005 22:16:11 -0000	1.67
  @@ -92,6 +92,7 @@
       private File destDir = null;
       private File file;
       private FixCrLfFilter filter = new FixCrLfFilter();
  +    private Vector fcv = null;
   
       /**
        * Encoding to assume for the files
  @@ -99,15 +100,6 @@
       private String encoding = null;
   
       /**
  -     * Defaults the properties based on the system type.
  -     * <ul><li>Unix: eol="LF" tab="asis" eof="remove"
  -     *     <li>Mac: eol="CR" tab="asis" eof="remove"
  -     *     <li>DOS: eol="CRLF" tab="asis" eof="asis"</ul>
  -     */
  -    public FixCRLF () {
  -    }
  -
  -    /**
        * Chain this task as a reader.
        * @param rdr Reader to chain.
        * @return a Reader.
  @@ -317,11 +309,12 @@
           long lastModified = srcFile.lastModified();
           File destD = destDir == null ? srcDir : destDir;
   
  -        FilterChain fc = new FilterChain();
  -        fc.add(filter);
  -        Vector fcv = new Vector(1);
  -        fcv.add(fc);
  -
  +        if (fcv == null) {
  +            FilterChain fc = new FilterChain();
  +            fc.add(filter);
  +            fcv = new Vector(1);
  +            fcv.add(fc);
  +        }
           File tmpFile = FILE_UTILS.createTempFile("fixcrlf", "", null);
           tmpFile.deleteOnExit();
           try {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org