RFR (L, final): 8218626: Add detailed message to NullPointerException describing what is null.

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Wed Oct 2 12:45:10 UTC 2019

Hi Mark, 

thanks for looking at my change! Can I add you as reviewer?

This webrev incorporates your patch as well as two fixes of 
issues that sneaked in implementing some recent reviews:
bytecodeUtils.cpp:449  1 --> 1ULL 
bytecodeUtils.cpp:460  move assertion to where len is known.

> This is very nice work!  I especially appreciate the thorough tests.
Thanks!  But adapting the many tests to changed messages is 
quite cumbersome :) Thanks for supplying the patch right away!

> Looking at the tests, and the details of the JEP, I noticed that the
> generated messages all end in a period (e.g., “... is null.”).  This
> is pretty unusual in the JDK and jarring to the eye
Actually, for me as a foreign speaker, proper punctuation makes
it easier to understand. Reading a statement without '.' makes
me feel it's incomplete. Intuitively, I try to complete it somehow if the
grammar does not make it obvious that it is a complete sentence.
But I will follow your advice here if no one else objects the other

> I also noticed that the generated messages use single quotes (‘'’) to
> quote the names of fields, etc., rather than double quotes (‘"’).
I'm fine with this, but I think hotspot uses "'" for citing code
quite consistently. E.g., have a look at 
This can easily be changed.  I could do a separate change 
for hotspot and change all uses of ' in exceptions to ". What 
do you think?

Best regards,

More information about the hotspot-runtime-dev mailing list