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.
http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-NPE/21-incremental/
http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-NPE/21/
> 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
way.
> 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
http://hg.openjdk.java.net/jdk/jdk/file/b25362cec8ce/src/hotspot/share/interpreter/linkResolver.cpp
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,
Goetz.
More information about the core-libs-dev
mailing list