Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14078

Admin helper fails to prettify NullPointerExceptions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0, 3.2.1, 3.1.3
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      org.apache.hadoop.hdfs.tools.AdminHelper has a method to prettifyExceptions:

        static String prettifyException(Exception e) {
          return e.getClass().getSimpleName() + ": "
              + e.getLocalizedMessage().split("\n")[0];
        }
      

      But if e is a NPE the e.getLocalizedMessage() could be null. In that case NPE will be thrown and the original error message will be lost.

        Attachments

        1. HDFS-14078.001.patch
          3 kB
          Marton Elek
        2. HDFS-14078.002.patch
          3 kB
          Marton Elek
        3. HDFS-14078.003.patch
          3 kB
          Marton Elek

          Activity

            People

            • Assignee:
              elek Marton Elek
              Reporter:
              elek Marton Elek
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: