Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9A9E311E9E for ; Mon, 5 May 2014 06:04:18 +0000 (UTC) Received: (qmail 35798 invoked by uid 500); 5 May 2014 06:04:17 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 35429 invoked by uid 500); 5 May 2014 06:04:16 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 35389 invoked by uid 99); 5 May 2014 06:04:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2014 06:04:15 +0000 Date: Mon, 5 May 2014 06:04:15 +0000 (UTC) From: "Ted Yu (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13989302#comment-13989302 ] Ted Yu commented on HADOOP-10517: --------------------------------- The reason that patch v2 doesn't work is that ZipOutputStream#closeEntry() should be called instead of ZipOutputStream#close(). See: http://docs.oracle.com/javase/6/docs/api/java/util/zip/ZipOutputStream.html#closeEntry() IOUtils.closeQuietly() calls close() method. > InputStream is not closed in two methods of JarFinder > ----------------------------------------------------- > > Key: HADOOP-10517 > URL: https://issues.apache.org/jira/browse/HADOOP-10517 > Project: Hadoop Common > Issue Type: Bug > Reporter: Ted Yu > Assignee: Ted Yu > Priority: Minor > Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt > > > JarFinder#jarDir() and JarFinder#zipDir() have such code: > {code} > InputStream is = new FileInputStream(f); > copyToZipStream(is, anEntry, zos); > {code} > The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)