NullAway: Practical Type-Based Null Safety for Java

07/03/2019
by   Subarno Banerjee, et al.
0

NullPointerExceptions (NPEs) are a key source of crashes in modern Java programs. Previous work has shown how such errors can be prevented at compile time via code annotations and pluggable type checking. However, such systems have been difficult to deploy on large-scale software projects, due to significant build-time overhead and / or a high annotation burden. This paper presents NullAway, a new type-based null safety checker for Java that overcomes these issues. NullAway has been carefully engineered for low overhead, so it can run as part of every build. Further, NullAway reduces annotation burden through targeted unsound assumptions, aiming for no false negatives in practice on checked code. Our evaluation shows that NullAway has significantly lower build-time overhead (1.15X) than comparable tools (2.8-5.1X). Further, on a corpus of production crash data for widely-used Android apps built with NullAway, remaining NPEs were due to unchecked third-party libraries (64 deliberate error suppressions (17 post-checking code modification (17 assumptions for checked code.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/04/2018

Characterizing the Usage and Impact of Java Annotations Over 1000+ Projects

As a kind of meta-data feature, annotations have been formally introduce...
research
12/09/2018

Practical Optional Types for Clojure

Typed Clojure is an optional type system for Clojure, a dynamic language...
research
08/09/2018

Safe Stream-Based Programming with Refinement Types

In stream-based programming, data sources are abstracted as a stream of ...
research
09/12/2019

Which of My Transient Type Checks Are Not (Almost) Free?

One form of type checking used in gradually typed language is transient ...
research
12/04/2017

A Quantitative Study of Java Software Buildability

Researchers, students and practitioners often encounter a situation when...
research
03/17/2021

An experience-based recommendation system to support migrations of Android applications from Java to Kotlin

In 2017, Google announced Kotlin as an official Android programming lang...
research
09/15/2023

MetaOCaml Theory and Implementation

Quasi-quotation (or, code templates) has long been used as a convenient ...

Please sign up or login with your details

Forgot password? Click here to reset