RFR(L): 8218628: Add detailed message to NullPointerException describing what is null.

Daniel Fuchs daniel.fuchs at oracle.com
Tue Feb 12 13:54:54 UTC 2019


Hi Goetz,

On 12/02/2019 14:14, Lindenmaier, Goetz wrote:
> StackWalker operates on the Java stack tracke, which does not contain the BCI
> to my knowledge. 

For what it's worth, StackWalker::StackFrame has the BCI: returned by

        public int getByteCodeIndex(); [1]

But I am not sure how you would use that in this case.
I mean - IIUC the stack would have to be walked when the exception
is raised - not when getMessage() is called. It's possible that
the BCI is encoded in the backtrace data though. I have not
checked.

best regards,

-- daniel

[1] 
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/StackWalker.StackFrame.html#getByteCodeIndex()


More information about the core-libs-dev mailing list