diff --git a/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java b/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java index 9f8484e5f..e7d24c7e3 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 Threads. */ 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