• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / NullAway / #490
93%

Build:
DEFAULT BRANCH: master
Ran 02 Apr 2021 05:22PM UTC
Jobs 1
Files 42
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
#490

push

github-actions

web-flow
Add baseline support for records (#377)

Fixes #374

Avoid throwing exceptions when the source code contains records.  Since
records are a new kind of class, refactor the switch statements that
make assertions about which elements and trees represent classes.  Use
general purpose `isClassElement` and `isClassTree` methods that are
forward-compatible with records instead of enumerating `ElementKind` or
`Tree.Kind` constants.

Refactor `checkFieldInitialization` to ignore final fields.  This check
was wrongly flagging records because it couldn't analyze record
constructors properly.  Without the change to ignore final fields, this
check runs into two kinds of trouble with records:

  1. It doesn't inspect record constructors at all because they are
     generated.  `NullAway.isConstructor(MethodTree)` returns false and
     so those trees are skipped.

  2. The trees for the generated constructors don't contain explicit
     field assignments.  That's just not how those were implemented.
     Something else is responsible for assigning the fields at runtime,
     apparently.

Rather than trying to teach NullAway about record constructors
specifically, count on javac to verify that all final fields are
initialized.  Presumably, if NullAway were to complain that a constructor
did not initialize a final field, that complaint would be redundant (with
the error that javac would produce) at best and incorrect otherwise.

Co-authored-by: Manu Sridharan <msridhar@gmail.com>

3465 of 3886 relevant lines covered (89.17%)

0.89 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #490.1 02 Apr 2021 05:22PM UTC 0
89.17
Source Files on build #490
Detailed source file information is not available for this build.
  • Back to Repo
  • e552ba76 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc