jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1719545 - /jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java
Date Fri, 11 Dec 2015 20:47:36 GMT
Author: pmouawad
Date: Fri Dec 11 20:47:35 2015
New Revision: 1719545

URL: http://svn.apache.org/viewvc?rev=1719545&view=rev
Log:
Use JOrphanUtils.closeQuietly

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java?rev=1719545&r1=1719544&r2=1719545&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/core/AbstractSampleWriter.java Fri Dec
11 20:47:35 2015
@@ -26,7 +26,7 @@ import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 
-import org.apache.jmeter.report.core.SampleException;
+import org.apache.jorphan.util.JOrphanUtils;
 
 /**
  * Base class for implementing sample writer.<br>
@@ -68,7 +68,7 @@ abstract public class AbstractSampleWrit
 
         if (this.writer != null) {
             // flush and close previous writer
-            safeClose(this.writer);
+            JOrphanUtils.closeQuietly(this.writer);
         }
         this.writer = new PrintWriter(new BufferedWriter(writer, BUF_SIZE), false);
     }
@@ -116,23 +116,10 @@ abstract public class AbstractSampleWrit
      */
     @Override
     public void close() {
-        safeClose(this.writer);
+	JOrphanUtils.closeQuietly(writer);
         this.writer = null;
     }
 
-    private void safeClose(Writer w) {
-        try {
-            w.flush();
-        } catch (Exception e) {
-            // ignore
-        }
-        try {
-            w.close();
-        } catch (Exception e) {
-            // ignore
-        }
-    }
-
     public void flush() {
         try {
             writer.flush();



Mime
View raw message