You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2013/09/03 01:12:28 UTC

svn commit: r1519529 - in /jmeter/trunk: src/jorphan/org/apache/jorphan/exec/StreamCopier.java xdocs/changes.xml

Author: sebb
Date: Mon Sep  2 23:12:27 2013
New Revision: 1519529

URL: http://svn.apache.org/r1519529
Log:
StreamCopier cannot be used with System.err or System.out as it closes the output stream
Bugzilla Id: 55513

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/exec/StreamCopier.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/exec/StreamCopier.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/exec/StreamCopier.java?rev=1519529&r1=1519528&r2=1519529&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/exec/StreamCopier.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/exec/StreamCopier.java Mon Sep  2 23:12:27 2013
@@ -52,15 +52,20 @@ class StreamCopier extends Thread {
      */
     @Override
     public void run() {
+        final boolean isSystemOutput = os.equals(System.out) || os.equals(System.err);
         try {
             IOUtils.copyLarge(is, os);
-            os.close();
+            if (!isSystemOutput){
+                os.close();
+            }
             is.close();
         } catch (IOException e) {
             log.warn("Error writing stream", e);
         } finally {
             IOUtils.closeQuietly(is);
-            IOUtils.closeQuietly(os);
+            if (!isSystemOutput){
+                IOUtils.closeQuietly(os);
+            }
         }
     }
     

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1519529&r1=1519528&r2=1519529&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Mon Sep  2 23:12:27 2013
@@ -417,6 +417,7 @@ Previously the default was 1, which coul
 <li><bugzilla>55423</bugzilla> - BatchSampleSender: Reduce locking granularity by moving listener.processBatch outside of synchronized block</li>
 <li><bugzilla>55424</bugzilla> - Add Stripping to existing SampleSenders</li>
 <li><bugzilla>55451</bugzilla> - Test Element GUI with JSyntaxTextArea scroll down when text content is long enough to add a Scrollbar</li>
+<li><bugzilla>55513</bugzilla> - StreamCopier cannot be used with System.err or System.out as it closes the output stream</li>
 </ul>
 
 <h2>Non-functional changes</h2>