Repository: ant
Updated Branches:
  refs/heads/master 36a2087a6 -> 4350b709a


add null guards when starting pumper threads

https://bz.apache.org/bugzilla/show_bug.cgi?id=62148


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/c851c310
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/c851c310
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/c851c310

Branch: refs/heads/master
Commit: c851c3102fb9e76975f906b9484d794be26c9df2
Parents: 0d30693
Author: Stefan Bodewig <[email protected]>
Authored: Tue Apr 17 11:40:07 2018 +0200
Committer: Stefan Bodewig <[email protected]>
Committed: Tue Apr 17 11:40:07 2018 +0200

----------------------------------------------------------------------
 .../apache/tools/ant/taskdefs/PumpStreamHandler.java  | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/c851c310/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java 
b/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
index 9f8484e..e7d24c7 100644
--- a/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
+++ b/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
@@ -134,11 +134,9 @@ public class PumpStreamHandler implements 
ExecuteStreamHandler {
      * Start the <code>Thread</code>s.
      */
     public void start() {
-        outputThread.start();
-        errorThread.start();
-        if (inputThread != null) {
-            inputThread.start();
-        }
+        start(outputThread);
+        start(errorThread);
+        start(inputThread);
     }
 
     /**
@@ -163,6 +161,12 @@ public class PumpStreamHandler implements 
ExecuteStreamHandler {
 
     private static final long JOIN_TIMEOUT = 200;
 
+    private void start(Thread t) {
+        if (t != null) {
+            t.start();
+        }
+    }
+
     /**
      * Waits for a thread to finish while trying to make it finish
      * quicker by stopping the pumper (if the thread is a {@link

Reply via email to