RFR(M): 8221077: No NullPointerException message if top frame is hidden.

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Mon May 6 10:22:44 UTC 2019


Hi,

Exceptions can print the stack trace of when the exception occurred.
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.)

If the top frame is omitted/hidden,
it is inconsistent to print a message telling where
exactly in the hidden method the error occurred.

Further, if the top frame is hidden, the information
needed to compute the message is missing. A wrong
message will be printed.

This change suppresses the NPE message if the NPE
occurred in a hidden top frame.
It 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 separated from this technical issue.

Please review:
https://bugs.openjdk.java.net/browse/JDK-8221077
http://cr.openjdk.java.net/~goetz/wr19/8221077-hidden_top_frame/02/
This change must be applied on top of
http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-NPE/08/

Best regards,
  Goetz.


More information about the hotspot-runtime-dev mailing list