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
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
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.