[jira] [Updated] (MAPREDUCE-6535) TaskID default constructor results in NPE on toString()
[ https://issues.apache.org/jira/browse/MAPREDUCE-6535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Lowe updated MAPREDUCE-6535: -- Resolution: Fixed Hadoop Flags: Reviewed Fix Version/s: 2.9.0 Status: Resolved (was: Patch Available) Thanks to [~templedf] for the contribution and to [~zxu] and [~rakesh_techie] for additional review! I committed this to trunk and branch-2. > 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 > Fix For: 2.9.0 > > 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)
[jira] [Updated] (MAPREDUCE-6535) TaskID default constructor results in NPE on toString()
[ https://issues.apache.org/jira/browse/MAPREDUCE-6535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Templeton updated MAPREDUCE-6535: Attachment: MAPREDUCE-6535.001.patch This patch sets the default task type to REDUCE. It also fixes all the javadocs and add a full set of unit tests. > 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)