ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r292520 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Checksum.java
Date Thu, 29 Sep 2005 19:27:26 GMT
Author: mbenson
Date: Thu Sep 29 12:27:22 2005
New Revision: 292520

URL: http://svn.apache.org/viewcvs?rev=292520&view=rev
Log:
(judiciously) use FileUtils.close()

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Checksum.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Checksum.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Checksum.java?rev=292520&r1=292519&r2=292520&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Checksum.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Checksum.java Thu Sep 29 12:27:22
2005
@@ -42,6 +42,7 @@
 import org.apache.tools.ant.taskdefs.condition.Condition;
 import org.apache.tools.ant.types.EnumeratedAttribute;
 import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.util.FileUtils;
 import org.apache.tools.ant.util.StringUtils;
 
 /**
@@ -543,20 +544,8 @@
         } catch (Exception e) {
             throw new BuildException(e, getLocation());
         } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
+            FileUtils.close(fis);
+            FileUtils.close(fos);
         }
         return checksumMatches;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message