Talk Proposal: Helpful NullPointerExceptions - The little thing that became a JEP

Langer, Christoph christoph.langer at sap.com
Fri Nov 29 13:55:38 CET 2019


Title: Helpful NullPointerExceptions - The little thing that became a JEP

Abstract:
One of the most prevalent - if not the most prevalent - exception type in Java is the NullPointerException. While Java set out to overcome the possibilities
to do the mistakes one can do when programming in languages like C/C++ by not exposing pointers in the Java language, the misleading term 'pointer' sneaked
into this exception. To this day, NullPointerExceptions thrown by the runtime system didn't contain messages. All you had was a callstack and a line number.
But in typical expressions and statements there are several dereferences where an NPE can occur in one line.

We - some engineers in the SAP team - thought this could be helped by a little enhancement. The new NPE message gives precise information about the location
and tries to explain what was going on when a null reference was encountered. However, due to its prominent nature, it eventually became a JEP.

In my talk I'll demonstrate the improvements that come with this enhancement. I will lift the hood a little and provide a glance at its implementation details.
And finally I'll say some words about the current status and share some ideas for further improvements in the area of exception messages.

Recording me on audio and/or video is acceptable.

Brief Bio: Christoph Langer is an engineer in SAP's Java VM team. He's engaged in the OpenJDK project in various areas, currently co-maintaining JDK 11 updates.

Microblog URL: https://twitter.com/TheRealClanger

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fosdem.org/pipermail/java-devroom/attachments/20191129/c22f309d/attachment.html>


More information about the java-devroom mailing list