We're creating a NullPointerException
and assuming that it will have no message. Due to Helpful NullPointerExceptions (JEP 358) this is no longer the case.
Comment From: dreis2211
You might be interested in the following: https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2020-June/040450.html
I was looking into this since yesterday already and asked the mailing list this morning. I'm pretty sure it's a bug in the JDK as explicitly created NPEs should have no extended message - according to the code.
Comment From: wilkinsona
Definitely interested, @dreis2211. Thanks for the pointer and for taking the time to report it to the JDK team.