Browse Source

make sure streams are closed, PR 40197, Submitted by Dave Brosius

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

+ 8
- 2
src/main/org/apache/tools/ant/filters/ReplaceTokens.java View File

@@ -22,8 +22,9 @@ import java.io.Reader;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;
import org.apache.tools.ant.types.Parameter;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.Parameter;
import org.apache.tools.ant.util.FileUtils;

/**
* Replaces tokens in the original input with user-supplied values.
@@ -227,12 +228,17 @@ public final class ReplaceTokens
* @param fileName The file to load properties from.
*/
private Properties getPropertiesFromFile (String fileName) {
FileInputStream in = null;
Properties props = new Properties();
try {
props.load(new FileInputStream(fileName));
in = new FileInputStream(fileName);
props.load(in);
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
FileUtils.close(in);
}
return props;
}



Loading…
Cancel
Save