Browse Source

- Try to close the file rather than relying on finalization.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271044 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 23 years ago
parent
commit
f52ac98213
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/main/org/apache/tools/ant/Main.java

+ 9
- 1
src/main/org/apache/tools/ant/Main.java View File

@@ -351,13 +351,21 @@ public class Main {
propertyFileIndex++) {
String filename = (String) propertyFiles.elementAt(propertyFileIndex);
Properties props = new Properties();
FileInputStream fis = null;
try {
FileInputStream fis = new FileInputStream(filename);
fis = new FileInputStream(filename);
props.load(fis);
}
catch (IOException e) {
System.out.println("Could not load property file "
+ filename + ": " + e.getMessage());
} finally {
if (fis != null){
try {
fis.close();
} catch (IOException e){
}
}
}
// ensure that -D properties take precedence


Loading…
Cancel
Save