jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1444363 - /jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
Date Sat, 09 Feb 2013 14:05:34 GMT
Author: pmouawad
Date: Sat Feb  9 14:05:34 2013
New Revision: 1444363

URL: http://svn.apache.org/r1444363
Log:
Fix file descriptor leak

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java?rev=1444363&r1=1444362&r2=1444363&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java Sat Feb  9 14:05:34
2013
@@ -409,7 +409,7 @@ public class PackageTest extends TestCas
                 // Look for calls to JMeterUtils.getResString()
                 final Pattern pat = Pattern.compile(".*getResString\\(\"([^\"]+)\"\\).*");
                 if (name.endsWith(".java")) {
-                  BufferedReader fileReader;
+                  BufferedReader fileReader = null;
                   try {
                     fileReader = new BufferedReader(new FileReader(file));
                     String s;
@@ -436,6 +436,8 @@ public class PackageTest extends TestCas
                     }
                 } catch (IOException e) {
                     e.printStackTrace();
+                } finally {
+                    JOrphanUtils.closeQuietly(fileReader);
                 }
                  
                 }



Mime
View raw message