ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r502505 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java
Date Fri, 02 Feb 2007 05:27:58 GMT
Author: kevj
Date: Thu Feb  1 21:27:57 2007
New Revision: 502505

URL: http://svn.apache.org/viewvc?view=rev&rev=502505
Log:
-use FileUtils.close

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java?view=diff&rev=502505&r1=502504&r2=502505
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java Thu Feb  1 21:27:57 2007
@@ -21,15 +21,15 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.io.Reader;
+import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -42,6 +42,7 @@
 import java.util.Vector;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
+
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.EnumeratedAttribute;
@@ -49,6 +50,7 @@
 import org.apache.tools.ant.types.ResourceCollection;
 import org.apache.tools.ant.types.ZipFileSet;
 import org.apache.tools.ant.types.spi.Service;
+import org.apache.tools.ant.util.FileUtils;
 import org.apache.tools.zip.JarMarker;
 import org.apache.tools.zip.ZipExtraField;
 import org.apache.tools.zip.ZipOutputStream;
@@ -267,13 +269,7 @@
                                      + manifestFile
                                      + " (" + e.getMessage() + ")", e);
         } finally {
-            if (isr != null) {
-                try {
-                    isr.close();
-                } catch (IOException e) {
-                    // do nothing
-                }
-            }
+            FileUtils.close(isr);
         }
         return newManifest;
     }
@@ -767,13 +763,7 @@
                                      getLocation());
         } finally {
             // Close the output stream.
-            try {
-                if (zOut != null) {
-                    zOut.close();
-                }
-            } catch (IOException ex) {
-                // Ignore close exception
-            }
+            FileUtils.close(zOut);
             createEmpty = false;
         }
         return true;



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


Mime
View raw message