Return-Path: X-Original-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-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 E0B1B18BEC for ; Thu, 24 Mar 2016 22:05:30 +0000 (UTC) Received: (qmail 99254 invoked by uid 500); 24 Mar 2016 22:05:25 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 99170 invoked by uid 500); 24 Mar 2016 22:05:25 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 99130 invoked by uid 99); 24 Mar 2016 22:05:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Mar 2016 22:05:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8516E2C1F68 for ; Thu, 24 Mar 2016 22:05:25 +0000 (UTC) Date: Thu, 24 Mar 2016 22:05:25 +0000 (UTC) From: "Jason Lowe (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MAPREDUCE-6535) TaskID default constructor results in NPE on toString() 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/MAPREDUCE-6535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15211032#comment-15211032 ] Jason Lowe commented on MAPREDUCE-6535: --------------------------------------- +1 lgtm. Will commit tomorrow if there are no objections. > TaskID default constructor results in NPE on toString() > ------------------------------------------------------- > > Key: MAPREDUCE-6535 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-6535 > Project: Hadoop Map/Reduce > Issue Type: Bug > Components: mrv2 > Affects Versions: 2.6.0 > Reporter: Daniel Templeton > Assignee: Daniel Templeton > Attachments: MAPREDUCE-6535.001.patch > > > This code will reproduce the issue: > {code} > new TaskAttemptID().toString(); > {code} > The issue is that the default constructor leaves the type {{null}}. The {{get()}} in {{CharTaskTypesMaps.getRepresentingCharacter()}} then throws an NPE on the null type key. > The simplest solution would be to only call the {{get()}} on line 288 of {{TaskID.java}} if {{type}} is not {{null}} and return some other literal otherwise. Since no part of the code is tripping on the NPE, what we choose for the literal shouldn't matter. How about "x"? -- This message was sent by Atlassian JIRA (v6.3.4#6332)