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

uber / NullAway / #584 / 1
93%
master: 93%

Build:
DEFAULT BRANCH: master
Ran 19 Oct 2021 09:44PM UTC
Files 43
Run time 10s
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

19 Oct 2021 09:40PM UTC coverage: 89.389% (+0.2%) from 89.186%
#584.1

push

github-actions

web-flow
Add basic library support for grpc Metadata through GrpcHandler (#505)

The primary goal of this PR is to support the usage of the class `io.grpc.Metadata` in a way that feels natural to how NullAway already handles maps. 

Handling `io.grpc.Metadata` is complicated by two factors:

* It implements `containsKey(...)` and `get(...)` methods that appear similar to the API of java maps, without actually implementing `java.util.Map`. Thus our existing support for maps can't handle this class, and this likely breaks developer expectations unless they are familiar with the implementation of both the grpc library and NullAway.
* Keys for `io.grpc.Metadata` aren't ever primitive types, but instead are usually references to fields of type `io.grpc.Metadata.Key<T>`. These fields are usually static and final (and the type is immutable), so they can safely be treated as constants, but our existing handling of compile-time constants in access paths is not enough here.

To solve this, we:

1) Implement equivalent logic to our usual map handling as a handler (`GrpcHandler`), which sets `x.y.z.get($foo)` as `@NonNull` on the then-branch whenever it sees a method node representing `x.y.z.containsKey($foo)`.
2) Improve on our handling of AccessPaths which include methods whose arguments point to static final fields of structurally immutable types (i.e. initialization-time constants, as opposed to compile-time). We allow handlers to declare the structurally immutable types they know (and care) about, rather than try to prove immutability as part of NullAway's analysis.

Note that a significant part of the code for implementing (2) involves threading knowledge of immutable types through the stateless AccessPath APIs. We accomplish this by creating a new `AccessPath.APContext` class, which is initialized by collecting information from all handlers whenever the dataflow analysis is initialized, and passed through all the operations manipulating access paths.

3597 of 4024 relevant lines covered (89.39%)

0.89 hits per line

Source Files on job #584.1
  • Tree
  • List 0
  • Changed 16
  • Source Changed 16
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 584
  • c970ea82 on github
  • Prev Job for on master (##581.1)
  • Next Job for on master (##587.1)
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