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 6545417913 for ; Wed, 12 Nov 2014 02:43:35 +0000 (UTC) Received: (qmail 34233 invoked by uid 500); 12 Nov 2014 02:43:34 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 34193 invoked by uid 500); 12 Nov 2014 02:43:34 -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 34177 invoked by uid 99); 12 Nov 2014 02:43:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 02:43:34 +0000 Date: Wed, 12 Nov 2014 02:43:34 +0000 (UTC) From: "Akira AJISAKA (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-10365) BufferedOutputStream in FileUtil#unpackEntries() should be closed in finally block 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-10365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14207585#comment-14207585 ] Akira AJISAKA commented on HADOOP-10365: ---------------------------------------- bq. So, need to cleanup. Agree. The patch looks mostly good. Minor nits: 1. {code} + } catch (IOException e) { + throw e; {code} These lines are no-op, so they can be removed. 2. {code} + outputStream = new BufferedOutputStream(new FileOutputStream(outputFile)) {code} Would you please render the line within 80 characters? > BufferedOutputStream in FileUtil#unpackEntries() should be closed in finally block > ---------------------------------------------------------------------------------- > > Key: HADOOP-10365 > URL: https://issues.apache.org/jira/browse/HADOOP-10365 > Project: Hadoop Common > Issue Type: Bug > Components: util > Reporter: Ted Yu > Priority: Minor > Attachments: HADOOP-10365.2.patch, HADOOP-10365.patch > > > {code} > BufferedOutputStream outputStream = new BufferedOutputStream( > new FileOutputStream(outputFile)); > ... > outputStream.flush(); > outputStream.close(); > {code} > outputStream should be closed in finally block. -- This message was sent by Atlassian JIRA (v6.3.4#6332)