bodewig     2003/04/24 02:37:48

  Modified:    src/main/org/apache/tools/ant/filters TokenFilter.java
  Log:
  More code reuse
  
  Revision  Changes    Path
  1.3       +2 -11     
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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TokenFilter.java  22 Apr 2003 18:23:54 -0000      1.2
  +++ TokenFilter.java  24 Apr 2003 09:37:48 -0000      1.3
  @@ -65,6 +65,7 @@
   import org.apache.tools.ant.types.Parameter;
   import org.apache.tools.ant.types.RegularExpression;
   import org.apache.tools.ant.types.Substitution;
  +import org.apache.tools.ant.util.FileUtils;
   import org.apache.tools.ant.util.regexp.Regexp;
   
   /**
  @@ -358,17 +359,7 @@
           public String getToken(Reader in)
               throws IOException
           {
  -            StringBuffer output = new StringBuffer();
  -            char[] buffer = new char[8192];
  -            while (true) {
  -                int nread = in.read(buffer, 0, 8192);
  -                if (nread == -1)
  -                    break;
  -                output.append(buffer, 0, nread);
  -            }
  -            if (output.length() == 0)
  -                return null;
  -            return output.toString();
  +            return FileUtils.readFully(in);
           }
   
           /**
  
  
  

Reply via email to