Video details

Helpful NullPointerExceptions - The little thing that became a JEP


by Christoph Langer
At: FOSDEM 2020
❮p❯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.❮/p❯
❮p❯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.❮/p❯
❮p❯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.❮/p❯
Room: H.1302 (Depage) Scheduled start: 2020-02-01 15:50:00