Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-8806

Potential null dereference in Metrics#incrementCounter()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Later
    • None
    • None
    • None
    • None

    Description

            if (!metrics.hasKey(name)) {
              value = Long.valueOf(increment);
              set(name, value);
            } else {
              value = ((Long)get(name)) + increment;
              set(name, value);
            }
      

      In the else block, if get(name) returns null, unboxing null object would lead to exception.

      Attachments

        1. HIVE-8806.1.patch
          0.8 kB
          denny joseph
        2. HIVE-8806.2.patch
          0.6 kB
          denny joseph

        Activity

          People

            Unassigned Unassigned
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: