ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <>
Subject Re: outputStream and errorStream in AbstractCvsTask
Date Thu, 15 Jul 2004 06:48:38 GMT
Hello Will,
the patch looks useful.
can you create an issue in Bugzilla and attach your patch to the issue.


> Hi, this is my first attempt to submit a fix to a open source project. 
> I've search thru the archive but could not find anything related.  Please
> forgive me if I'm missing anything.
> I have a custom task (CvsMergeTask) extending AbstractCvsTask.  It reads
> thru the entries in changlog.xml (from ChangeLogTask) and generates a
> of cvs commands and insert them into vecCommandlines using
> addConfiguredCommandline(Commandline).
> The problem was with output of the commands.  When directing output of the
> commands to a file using the "output" and "error" attributes, only the
> output of the 1st command executed was redirected - the output from the
> of the cvs commands are lost.  The reason is because for each cvs commands
> in vecCommandlines, runCommand(Commandline) is executed and outputStream
> errorStream are closed in the finally block in runCommand(Commandline). 
> Thus, right after runCommand(Commandline) is called for the 1st command in
> vecCommandlines, the outputStream and errorStream are closed and never
> re-opened, and therefore unavaliable to the subsequent commands when
> runCommand(Commandline) is called.
> The solution I have is to moved the close() call of both outputStream and
> errorStream to the finally block execute() method. (Patch attached).  The
> reason is that "only close the outputStream and errorStream after all
> commands are executed."  Let me know what you think!  :)
> Thanks,
> Will

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message