Browse Source

make sure <propertyfile> closes the file it's been reading from.

Submitted by:	Magesh Umasankar <umagesh@rediffmail.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269815 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
8d66f263f5
2 changed files with 8 additions and 2 deletions
  1. +2
    -0
      WHATSNEW
  2. +6
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java

+ 2
- 0
WHATSNEW View File

@@ -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.

* <propertyfile> would not close the original property file.

Changes from Ant 1.4 to Ant 1.4.1
===========================================



+ 6
- 2
src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java View File

@@ -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
{


Loading…
Cancel
Save