From 8d66f263f5f40ed0a8fce0af2583ebe0b01354ab Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 23 Oct 2001 11:49:45 +0000 Subject: [PATCH] make sure closes the file it's been reading from. Submitted by: Magesh Umasankar git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269815 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 2 ++ .../apache/tools/ant/taskdefs/optional/PropertyFile.java | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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 {