diff --git a/WHATSNEW b/WHATSNEW index 0375b1666..981e75d7c 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -26,6 +26,8 @@ Fixed bugs: * Fixed bug where ant would not copy system properties into new Project in ant/antcall tasks when inheritall="false" is set. +* would not close the original property file. + Changes from Ant 1.4 to Ant 1.4.1 =========================================== diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java b/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java index 74cf4aa97..d79d7ff56 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java @@ -203,8 +203,12 @@ public class PropertyFile extends Task if (m_propertyfile.exists()) { log("Updating property file: "+m_propertyfile.getAbsolutePath()); - m_properties.load(new BufferedInputStream( - new FileInputStream(m_propertyfile))); + FileInputStream fis = new FileInputStream(m_propertyfile); + BufferedInputStream bis = new BufferedInputStream(fis); + m_properties.load(bis); + if (fis != null) { + fis.close(); + } } else {