Browse Source

use the FileUtils#close method

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277121 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
677491b927
1 changed files with 6 additions and 18 deletions
  1. +6
    -18
      src/main/org/apache/tools/ant/util/FileUtils.java

+ 6
- 18
src/main/org/apache/tools/ant/util/FileUtils.java View File

@@ -566,12 +566,8 @@ public class FileUtils {
line = lineTokenizer.getToken(in);
}
} finally {
if (out != null) {
out.close();
}
if (in != null) {
in.close();
}
close(out);
close(in);
}
} else if (filterChainsAvailable
|| (inputEncoding != null
@@ -619,12 +615,8 @@ public class FileUtils {
out.write(buffer, 0, nRead);
}
} finally {
if (out != null) {
out.close();
}
if (in != null) {
in.close();
}
close(out);
close(in);
}
} else {
FileInputStream in = null;
@@ -640,12 +632,8 @@ public class FileUtils {
count = in.read(buffer, 0, buffer.length);
} while (count != -1);
} finally {
if (out != null) {
out.close();
}
if (in != null) {
in.close();
}
close(out);
close(in);
}
}



Loading…
Cancel
Save