From 0a03dc4b5d65a49b82daa5a695e02d86bf749183 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 15 Dec 2004 12:10:43 +0000 Subject: [PATCH] Use close method to close streams, Submitted by Kevin Jackson git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277207 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/util/FileUtils.java | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java index ec5941cf4..92066cfa9 100644 --- a/src/main/org/apache/tools/ant/util/FileUtils.java +++ b/src/main/org/apache/tools/ant/util/FileUtils.java @@ -614,9 +614,9 @@ public class FileUtils { } out.write(buffer, 0, nRead); } - } finally { - close(out); - close(in); + } finally { + close(out); + close(in); } } else { FileInputStream in = null; @@ -1012,20 +1012,8 @@ public class FileUtils { } return true; } finally { - if (in1 != null) { - try { - in1.close(); - } catch (IOException e) { - // ignore - } - } - if (in2 != null) { - try { - in2.close(); - } catch (IOException e) { - // ignore - } - } + close(in1); + close(in2); } }