bodewig 01/10/23 04:49:45
Modified: . WHATSNEW
src/main/org/apache/tools/ant/taskdefs/optional
PropertyFile.java
Log:
make sure <propertyfile> closes the file it's been reading from.
Submitted by: Magesh Umasankar <[EMAIL PROTECTED]>
Revision Changes Path
1.157 +2 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -r1.156 -r1.157
--- WHATSNEW 2001/10/23 10:35:14 1.156
+++ WHATSNEW 2001/10/23 11:49:45 1.157
@@ -26,6 +26,8 @@
* 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
===========================================
1.7 +6 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
Index: PropertyFile.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PropertyFile.java 2001/10/18 10:16:17 1.6
+++ PropertyFile.java 2001/10/23 11:49:45 1.7
@@ -203,8 +203,12 @@
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
{