maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r739030 - /maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
Date Thu, 29 Jan 2009 21:43:09 GMT
Author: bentmann
Date: Thu Jan 29 21:43:09 2009
New Revision: 739030

URL: http://svn.apache.org/viewvc?rev=739030&view=rev
Log:
o Fixed file handle leak

Modified:
    maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java

Modified: maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java?rev=739030&r1=739029&r2=739030&view=diff
==============================================================================
--- maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java (original)
+++ maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java Thu
Jan 29 21:43:09 2009
@@ -306,14 +306,20 @@
     {
         Properties properties = new Properties();
 
-        FileInputStream fis;
         try
         {
             File propertiesFile = new File( getBasedir(), filename );
             if ( propertiesFile.exists() )
             {
-                fis = new FileInputStream( propertiesFile );
-                properties.load( fis );
+                FileInputStream fis = new FileInputStream( propertiesFile );
+                try
+                {
+                    properties.load( fis );
+                }
+                finally
+                {
+                    fis.close();
+                }
             }
         }
         catch ( FileNotFoundException e )



Mime
View raw message