public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chapman Flack <[email protected]>
To: [email protected] <[email protected]>
Subject: Java 14 "Helpful NullPointerExceptions"
Date: Sat, 30 May 2020 15:16:35 -0400
Message-ID: <[email protected]> (raw)

There is a great option to add in pljava.vmoptions when running on
Java 14 or later:

  -XX:+ShowCodeDetailsInExceptionMessages


It arranges so that if a NullPointerException is ever thrown, instead of

  ERROR:  java.lang.NullPointerException

you see something like

  ERROR:  java.lang.NullPointerException: Cannot assign field "i" because
"a" is null


A little thing, but handy, and very easy to enable. It doesn't add to the
cost of null-pointer exceptions thrown and caught internally, because the
work is only done if the message is used. [1]

-Chap


[1] https://openjdk.java.net/jeps/358





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Java 14 "Helpful NullPointerExceptions"
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox