jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1204146 - /jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java
Date Sun, 20 Nov 2011 11:25:11 GMT
Author: pmouawad
Date: Sun Nov 20 11:25:11 2011
New Revision: 1204146

URL: http://svn.apache.org/viewvc?rev=1204146&view=rev
Log:
inputstream never closed

Modified:
    jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java

Modified: jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java?rev=1204146&r1=1204145&r2=1204146&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java (original)
+++ jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java Sun Nov 20 11:25:11 2011
@@ -22,6 +22,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.InputStream;
 import java.lang.reflect.Method;
 import java.nio.charset.Charset;
 import java.util.List;
@@ -261,14 +262,18 @@ public final class AllTests {
     protected static void initializeLogging(String[] args) {
         if (args.length >= 2) {
             Properties props = new Properties();
+            InputStream inputStream = null;
             try {
                 System.out.println("Setting up logging props using file: " + args[1]);
-                props.load(new FileInputStream(args[1]));
+            	inputStream = new FileInputStream(args[1]);
+                props.load(inputStream);
                 LoggingManager.initializeLogging(props);
             } catch (FileNotFoundException e) {
                 System.out.println(e.getLocalizedMessage());
             } catch (IOException e) {
                 System.out.println(e.getLocalizedMessage());
+            } finally {
+            	JOrphanUtils.closeQuietly(inputStream);
             }
         }
     }



Mime
View raw message