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

Admin helper fails to prettify NullPointerExceptions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.0, 3.2.1, 3.1.3
    • None
    • None

    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

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

            Dates

              Created:
              Updated:
              Resolved: