Non-null references by default in java: Alleviating the nullity annotation burden

42Citations
Citations of this article
13Readers
Mendeley users who have this article in their library.
Get full text

Abstract

With Java 5 annotations, we note a marked increase in tools that statically detect potential null dereferences. To be effective such tools require that developers annotate declarations with nullity modifiers and have annotated API libraries. Unfortunately, in our experience specifying moderately large code bases, the use of non-null annotations is more labor intensive than it should be. Motivated by this experience, we conducted an empirical study of 5 open source projects totaling 700 KLOC which confirms that on average, 3/4 of declarations are meant to be non-null, by design. Guided by these results, we propose adopting a non-null-by-default semantics. This new default has advantages of better matching general practice, lightening developer annotation burden and being safer. We adapted the Eclipse JDT Core to support the new semantics, including the ability to read the extensive API library specifications written in the Java Modeling Language (JML). Issues of backwards compatibility are addressed. © Springer-Verlag Berlin Heidelberg 2007.

Cite

CITATION STYLE

APA

Chalin, P., & James, P. R. (2007). Non-null references by default in java: Alleviating the nullity annotation burden. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 4609 LNCS, pp. 227–247). Springer Verlag. https://doi.org/10.1007/978-3-540-73589-2_12

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free