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

No NullPointerException message if top frame is hidden.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 13
    • hotspot


      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.

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

              Created:
              Updated:
              Resolved: