We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Helpful NullPointerExceptions - The little thing that became a JEP

Formale Metadaten

Titel
Helpful NullPointerExceptions - The little thing that became a JEP
Serientitel
Anzahl der Teile
490
Autor
Lizenz
CC-Namensnennung 2.0 Belgien:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen.
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache

Inhaltliche Metadaten

Fachgebiet
Genre
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.