RFR: 8248476: No helpful NullPointerException message after calling fillInStackTrace
david.holmes at oracle.com
Mon Jun 29 13:19:29 UTC 2020
On 29/06/2020 9:17 pm, Lindenmaier, Goetz wrote:
> If changing the stack trace by calling fillInStackTrace in user code, the
> NPE algorithm lacks the proper information to compute the message.
> Thus, we must omit it after that call.
For those of us who didn't follow this work in detail could you outline
exactly when in the lifecycle of a NPE the detailed error message is
created. I'm having trouble understanding the exact nature of the
problem, and thus the fix.
> I implement this by checking for a call to fillInStackTrace at the bci
> recorded in the exception.
> Is there any other way of changing the stack trace? setStackTrace() is
> no problem as it does not change the internal backtrace datastructure.
> I'll push the change to jdk/submit and run it through our CI before pushing.
> Best regards,
More information about the hotspot-runtime-dev