Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8221077

No NullPointerException message if top frame is hidden.

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 13
    • Fix Version/s: tbd
    • Component/s: hotspot

      Description


      Exceptions can print the stack trace of when the exception occured.
      There can be methods on the stack that have been generated by
      the runtime. To not confuse the reader of the stackTrace,
      these are omitted (if -XX:-ShowHiddenFrames, which is default.)

      The frames are already dropped when the backtrace datastructure is
      built.

      If a NullPointerException is raised in a method whose stack
      frame will be hidden, a message based on the wrong method
      is printed. This is because the message is generated on base
      of the backtrace, which lacks the real top frame.

      This change adds a java.lang.Boolean(true) to the backtrace
      in case the real top frame is a hidden one and is dropped.

      When the NullPointerException message text is generated, this is
      checked and the message is skipped if the proper frame is not
      available.

      I handle this in a bug itself to keep the discussion of
      the basic feature seperated from this technical issue.

      The problem exists independent of the language chosen
      to implement generating the message.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              goetz Goetz Lindenmaier
              Reporter:
              goetz Goetz Lindenmaier
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: