From 11d029431b023d8be1ccb2240ca7e6cdde99748d Mon Sep 17 00:00:00 2001 From: Nicolas Lalevee Date: Sun, 15 Aug 2010 09:09:37 +0000 Subject: [PATCH] Bug #49119 : A forked task is creating a pumping thread on the input stream. The read was made blocking, so the pumping thread is still blocked after finished. So it will steal the first flushed charaters from the input stream. Making the pumping non blocking fixed the issue. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@985632 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 4 ++++ src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index c6c27fc6c..b970db53c 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -119,6 +119,10 @@ Fixed bugs: s that used the prefix or fullpath attributes. Bugzilla Report 49605. + * If forked, after finished was still reading the input stream + for a bunch of characters, then stealing them from a following . + Bugzilla Report 49119. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java b/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java index 573f40679..049023194 100644 --- a/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java +++ b/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java @@ -257,7 +257,7 @@ public class PumpStreamHandler implements ExecuteStreamHandler { /*protected*/ StreamPumper createInputPump(InputStream is, OutputStream os, boolean closeWhenExhausted) { StreamPumper pumper = new StreamPumper(is, os, closeWhenExhausted, - false); + true); pumper.setAutoflush(true); return pumper; }