Sciweavers

ECOOP
2007
Springer

Non-null References by Default in Java: Alleviating the Nullity Annotation Burden

14 years 4 months ago
Non-null References by Default in Java: Alleviating the Nullity Annotation Burden
With the advent of Java 5 annotations, we note a marked increase in the availability of tools that can statically detect potential null dereferences. For such tools to be truly effective, they require that developers annotate declarations in their code with nullity modifiers and have annotated API libraries. Unfortunately, it has been our experience in specifying moderately large code bases that 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 (including the Eclipse 3.3 JDT Core) totaling over 700 KLOC. The results allow us to confirm that in Java programs, at least 2/3 of declarations of reference types are meant to be non-null, by design. Guided by these results, we propose a new non-null-by-default semantics. This new default has the advantages of better matching general practice, lightening the annotation burden of developers and being safer. We describe how we have ada...
Patrice Chalin, Perry R. James
Added 14 Aug 2010
Updated 14 Aug 2010
Type Conference
Year 2007
Where ECOOP
Authors Patrice Chalin, Perry R. James
Comments (0)