ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant Main.java
Date Sat, 02 Feb 2002 00:11:59 GMT
Thanks!


----- Original Message -----
From: <sbailliez@apache.org>
To: <jakarta-ant-cvs@apache.org>
Sent: Friday, February 01, 2002 5:46 PM
Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant Main.java


> sbailliez    02/02/01 14:46:51
>
>   Modified:    src/main/org/apache/tools/ant Main.java
>   Log:
>   - Try to close the file rather than relying on finalization.
>
>   Revision  Changes    Path
>   1.55      +9 -1      jakarta-ant/src/main/org/apache/tools/ant/Main.java
>
>   Index: Main.java
>   ===================================================================
>   RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Main.java,v
>   retrieving revision 1.54
>   retrieving revision 1.55
>   diff -u -r1.54 -r1.55
>   --- Main.java 1 Feb 2002 22:27:38 -0000 1.54
>   +++ Main.java 1 Feb 2002 22:46:51 -0000 1.55
>   @@ -351,13 +351,21 @@
>                 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
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message