git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@517988 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -23,6 +23,7 @@ import java.util.Map; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.types.resources.TarResource; | import org.apache.tools.ant.types.resources.TarResource; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| import org.apache.tools.tar.TarEntry; | import org.apache.tools.tar.TarEntry; | ||||
| import org.apache.tools.tar.TarInputStream; | import org.apache.tools.tar.TarInputStream; | ||||
| @@ -79,13 +80,7 @@ public class TarScanner extends ArchiveScanner { | |||||
| } catch (IOException ex) { | } catch (IOException ex) { | ||||
| throw new BuildException("problem reading " + srcFile, ex); | throw new BuildException("problem reading " + srcFile, ex); | ||||
| } finally { | } finally { | ||||
| if (ti != null) { | |||||
| try { | |||||
| ti.close(); | |||||
| } catch (IOException ex) { | |||||
| // swallow | |||||
| } | |||||
| } | |||||
| FileUtils.close(ti); | |||||
| } | } | ||||
| } | } | ||||
| } | |||||
| } | |||||
| @@ -27,6 +27,7 @@ import java.util.zip.ZipException; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.types.resources.FileResource; | import org.apache.tools.ant.types.resources.FileResource; | ||||
| import org.apache.tools.ant.types.resources.ZipResource; | import org.apache.tools.ant.types.resources.ZipResource; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| import org.apache.tools.zip.ZipEntry; | import org.apache.tools.zip.ZipEntry; | ||||
| import org.apache.tools.zip.ZipFile; | import org.apache.tools.zip.ZipFile; | ||||
| @@ -92,13 +93,7 @@ public class ZipScanner extends ArchiveScanner { | |||||
| } | } | ||||
| } | } | ||||
| } finally { | } finally { | ||||
| if (zf != null) { | |||||
| try { | |||||
| zf.close(); | |||||
| } catch (IOException ex) { | |||||
| // swallow | |||||
| } | |||||
| } | |||||
| ZipFile.closeQuietly(zf); | |||||
| } | } | ||||
| } | } | ||||
| } | |||||
| } | |||||