Zurück zur Übersicht

Null Check Analysis

Publikationsart Peer-reviewed
Publikationsform Tagungsbeitrag (peer-reviewed)
Publikationsdatum 2015
Projekt Agile Software Assessment
Alle Daten anzeigen

Tagungsbeitrag (peer-reviewed)

Titel der Proceedings Extended Abstracts of the Eighth Seminar on Advanced Techniques and Tools for Software Evolution (SA


Null dereferencing is one of the most frequent bugs in Java systems causing programs to crash due to the uncaught NullPointerException. Developers often fix this bug by introducing a guard (i.e., null check) on the potentially-null objects before using them. In this paper we investigate the null checks in 717 open-source Java systems to understand when and why developers introduce null checks. We find that 35% of the if-statements are null checks. A deeper investigation shows that 71% of the checked-for-null objects are returned from method calls. This indicates that null checks have a serious impact on performance and that developers introduce null checks when they use methods that return null.