From 6bec8892b6d500c7cae0dffdd693b595b77508c6 Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Sun, 16 Feb 2003 14:05:42 +0000 Subject: [PATCH] Make sure stream gets closed when input finishes git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274092 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/StreamPumper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java b/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java index 17de047f1..37465fbf7 100644 --- a/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java +++ b/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java @@ -119,12 +119,12 @@ public class StreamPumper implements Runnable { while ((length = is.read(buf)) > 0) { os.write(buf, 0, length); } - if (closeWhenExhausted) { - os.close(); - } } catch (Exception e) { // ignore errors } finally { + if (closeWhenExhausted) { + os.close(); + } synchronized (this) { finished = true; notify();