Software Open Access

NullAway: Practical Type-Based Null Safety for Java

Subarno Banerjee; Lazaro Clapp; Manu Sridharan


DataCite XML Export

<?xml version='1.0' encoding='utf-8'?>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
  <identifier identifierType="DOI">10.5281/zenodo.3267950</identifier>
  <creators>
    <creator>
      <creatorName>Subarno Banerjee</creatorName>
      <affiliation>University of Michigan</affiliation>
    </creator>
    <creator>
      <creatorName>Lazaro Clapp</creatorName>
      <affiliation>Uber Technologies, Inc.</affiliation>
    </creator>
    <creator>
      <creatorName>Manu Sridharan</creatorName>
      <affiliation>University of California, Riverside</affiliation>
    </creator>
  </creators>
  <titles>
    <title>NullAway: Practical Type-Based Null Safety for Java</title>
  </titles>
  <publisher>Zenodo</publisher>
  <publicationYear>2019</publicationYear>
  <subjects>
    <subject>static code analysis</subject>
    <subject>pluggable type systems</subject>
    <subject>null safety</subject>
    <subject>java</subject>
  </subjects>
  <dates>
    <date dateType="Issued">2019-07-01</date>
  </dates>
  <language>en</language>
  <resourceType resourceTypeGeneral="Software"/>
  <alternateIdentifiers>
    <alternateIdentifier alternateIdentifierType="url">https://zenodo.org/record/3267950</alternateIdentifier>
  </alternateIdentifiers>
  <relatedIdentifiers>
    <relatedIdentifier relatedIdentifierType="DOI" relationType="IsVersionOf">10.5281/zenodo.3267949</relatedIdentifier>
  </relatedIdentifiers>
  <version>0.6.4</version>
  <rightsList>
    <rights rightsURI="http://www.opensource.org/licenses/MIT">MIT License</rights>
    <rights rightsURI="info:eu-repo/semantics/openAccess">Open Access</rights>
  </rightsList>
  <descriptions>
    <description descriptionType="Abstract">&lt;p&gt;NullAway is a tool to help eliminate&amp;nbsp;&lt;code&gt;NullPointerException&lt;/code&gt;s (NPEs) in your Java code. To use NullAway, first add&amp;nbsp;&lt;code&gt;@Nullable&amp;nbsp;&lt;/code&gt;annotations in your code wherever a field, method parameter, or return value may be&amp;nbsp;&lt;code&gt;null&lt;/code&gt;. Given these annotations, NullAway performs a series of type-based, local checks to ensure that any pointer that gets dereferenced in your code cannot be&amp;nbsp;&lt;code&gt;null&lt;/code&gt;. NullAway is similar to the type-based nullability checking in the Kotlin and Swift languages, and the&amp;nbsp;&lt;a href="https://checkerframework.org/"&gt;Checker Framework&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://fbinfer.com/docs/eradicate.html"&gt;Eradicate&lt;/a&gt;&amp;nbsp;null checkers for Java.&lt;/p&gt;

&lt;p&gt;NullAway is&amp;nbsp;&lt;em&gt;fast&lt;/em&gt;. It is built as a plugin to&amp;nbsp;&lt;a href="http://errorprone.info/"&gt;Error Prone&lt;/a&gt;&amp;nbsp;and can run on every single build of your code. In our measurements, the build-time overhead of running NullAway is usually less than 10%. NullAway is also&amp;nbsp;&lt;em&gt;practical&lt;/em&gt;: it does not prevent all possible NPEs in your code, but it catches most of the NPEs we have observed in production while imposing a reasonable annotation burden.&lt;/p&gt;</description>
  </descriptions>
</resource>
43
4
views
downloads
All versions This version
Views 4343
Downloads 44
Data volume 5.0 MB5.0 MB
Unique views 3131
Unique downloads 44

Share

Cite as