JEP 358 (Helpful NPEs) and single source file mode

Jonathan Gibbons jonathan.gibbons at
Tue Nov 19 18:39:09 UTC 2019

It's a design constraint that the "single source file mode" does not and 
should not support javac-specific command-line options beyond those that 
are also runtime options (for example, --class-path).

That being said, since one of the use cases is for beginners learning 
Java, it seems reasonable to support debugging information in that case. 
The other use case is for scripts/shebang files, and the debugging 
information should not be an onerous overhead in that case as well.

Therefore, I'm inclined to agree with the suggestion.

-- Jon

On 11/19/19 12:40 AM, Remi Forax wrote:
> ----- Mail original -----
>> De: "Gunnar Morling" <gunnar at>
>> À: "core-libs-dev" <core-libs-dev at>
>> Envoyé: Mardi 19 Novembre 2019 09:34:41
>> Objet: JEP 358 (Helpful NPEs) and single source file mode
>> Hi,
>> I've been exploring the new helpful NPE feature a bit.
>> It's a very welcomed improvement, but I noticed one potential usability
>> issue in conjunction with the single source file mode (JEP 330): as debug
>> info is missing in that case, e.g. local variables are rendered as
>> "<local1>" in the exception message. Single source file mode also doesn't
>> let me specify the "-g:vars" option I could use with javac for adding the
>> debugging info.
>> Perhaps single source file mode should add debug information by default to
>> prevent this issue?
> yes !
>> Thanks,
>> --Gunnar
> Rémi

More information about the compiler-dev mailing list