You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2004/12/03 17:33:26 UTC
cvs commit: ant/src/main/org/apache/tools/ant/util FileUtils.java
peterreilly 2004/12/03 08:33:26
Modified: src/main/org/apache/tools/ant/util FileUtils.java
Log:
use the FileUtils#close method
Revision Changes Path
1.74 +7 -19 ant/src/main/org/apache/tools/ant/util/FileUtils.java
Index: FileUtils.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- FileUtils.java 22 Nov 2004 18:18:42 -0000 1.73
+++ FileUtils.java 3 Dec 2004 16:33:26 -0000 1.74
@@ -566,12 +566,8 @@
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 @@
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 @@
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);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org