Browse Source

More code reuse

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274511 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
ec1437bc19
1 changed files with 2 additions and 11 deletions
  1. +2
    -11
      src/main/org/apache/tools/ant/filters/TokenFilter.java

+ 2
- 11
src/main/org/apache/tools/ant/filters/TokenFilter.java View File

@@ -65,6 +65,7 @@ import org.apache.tools.ant.types.EnumeratedAttribute;
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 class TokenFilter
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);
}

/**


Loading…
Cancel
Save