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 435EF17900 for ; Wed, 3 Jun 2015 00:15:11 +0000 (UTC) Received: (qmail 83403 invoked by uid 500); 2 Jun 2015 22:25:50 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 83332 invoked by uid 500); 2 Jun 2015 22:25:50 -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 83070 invoked by uid 99); 2 Jun 2015 22:25:50 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2015 22:25:50 +0000 Date: Tue, 2 Jun 2015 22:25:50 +0000 (UTC) From: "zhihai xu (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-12056) DiskChecker#checkDirs should check null pointer for the return value from File#listFiles to avoid NPE. 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-12056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] zhihai xu updated HADOOP-12056: ------------------------------- Attachment: HADOOP-12056.000.patch > DiskChecker#checkDirs should check null pointer for the return value from File#listFiles to avoid NPE. > ------------------------------------------------------------------------------------------------------ > > Key: HADOOP-12056 > URL: https://issues.apache.org/jira/browse/HADOOP-12056 > Project: Hadoop Common > Issue Type: Bug > Components: util > Affects Versions: 2.7.0 > Reporter: zhihai xu > Assignee: zhihai xu > Attachments: HADOOP-12056.000.patch > > > DiskChecker#checkDirs should check null pointer for the return value from File#listFiles. Based on the document for File#listFiles at https://docs.oracle.com/javase/7/docs/api/java/io/File.html#listFiles() : > {code} > Returns null if an I/O error occurs. > {code} > So it will be good to check null pointer and throw DiskErrorException if it is null. -- This message was sent by Atlassian JIRA (v6.3.4#6332)