Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-6535

TaskID default constructor results in NPE on toString()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.6.0
    • 2.9.0, 3.0.0-alpha1
    • mrv2
    • None
    • Reviewed

    Description

      This code will reproduce the issue:

      new TaskAttemptID().toString();
      

      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"?

      Attachments

        1. MAPREDUCE-6535.001.patch
          21 kB
          Daniel Templeton

        Activity

          People

            templedf Daniel Templeton
            templedf Daniel Templeton
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: