Browse Source

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
master
Conor MacNeill 22 years ago
parent
commit
6bec8892b6
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/StreamPumper.java

+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/StreamPumper.java View File

@@ -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();


Loading…
Cancel
Save