From 236873d6eb74a5ceaa0aae78f748946557595cf3 Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Sat, 17 Jul 2004 15:10:11 +0000 Subject: [PATCH] Prevent AbstractCvsTask from closing its output and error streams prematurely PR: 30097 Submitted by: Will Wang (telerice at yahoo dot com) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276705 13f79535-47bb-0310-9956-ffa450edef68 --- CONTRIBUTORS | 1 + WHATSNEW | 17 ++++++++++- .../tools/ant/taskdefs/AbstractCvsTask.java | 30 +++++++++---------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 268a994a1..d11f5d21a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -196,6 +196,7 @@ Tim Stephenson Tom Dimock Tom Eugelink Ulrich Schmidt +Will Wang William Ferguson Wolfgang Werner Wolf Siberski diff --git a/WHATSNEW b/WHATSNEW index c0324ed87..21ed616f6 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -28,12 +28,27 @@ Other changes: specification of multiple sub-build targets, which are executed with a single dependency analysis. -Changes from Ant 1.6.1 to current Ant 1.6 CVS version +Changes from Ant 1.6.2 to current Ant 1.6 CVS version ===================================================== Changes that could break older environments: -------------------------------------------- +Other changes: +-------------- + +Fixed bugs: +----------- + +* AbstractCvsTask prematurely closed its outputStream and errorStream. + Bugzilla 30097. + +Changes from Ant 1.6.1 to Ant 1.6.2 +=================================== + +Changes that could break older environments: +-------------------------------------------- + * The import task used the canonical version of a file path. This has been changed to use the absolute path. Bugzilla 28505. diff --git a/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java b/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java index 278274bd9..532a8eef2 100644 --- a/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java @@ -365,21 +365,6 @@ public abstract class AbstractCvsTask extends Task { } else { log("Caught exception: " + e.getMessage(), Project.MSG_WARN); } - } finally { - if (outputStream != null) { - try { - outputStream.close(); - } catch (IOException e) { - //ignore - } - } - if (errorStream != null) { - try { - errorStream.close(); - } catch (IOException e) { - //ignore - } - } } } @@ -413,6 +398,21 @@ public abstract class AbstractCvsTask extends Task { removeCommandline(cloned); } setCommand(savedCommand); + + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + //ignore + } + } + if (errorStream != null) { + try { + errorStream.close(); + } catch (IOException e) { + //ignore + } + } } }