This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit 574bdad6c9613a8f2dc992d72188f11b4b673eca
Author: Alex Herbert <[email protected]>
AuthorDate: Wed May 15 19:36:34 2019 +0100

    Do not close stdout when finished writing to it.
---
 .../org/apache/commons/rng/examples/stress/OutputCommand.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/commons-rng-examples/examples-stress/src/main/java/org/apache/commons/rng/examples/stress/OutputCommand.java
 
b/commons-rng-examples/examples-stress/src/main/java/org/apache/commons/rng/examples/stress/OutputCommand.java
index fa0b6c4..9c01b91 100644
--- 
a/commons-rng-examples/examples-stress/src/main/java/org/apache/commons/rng/examples/stress/OutputCommand.java
+++ 
b/commons-rng-examples/examples-stress/src/main/java/org/apache/commons/rng/examples/stress/OutputCommand.java
@@ -30,6 +30,7 @@ import java.io.DataOutputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
+import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
@@ -221,7 +222,12 @@ class OutputCommand implements Callable<Void> {
                 throw new ApplicationException("Failed to create output: " + 
fileOutput, ex);
             }
         }
-        return System.out;
+        return new FilterOutputStream(System.out) {
+            @Override
+            public void close() throws IOException {
+                // Do not close stdout
+            }
+        };
     }
 
     /**

Reply via email to