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

uber / NullAway / #977
93%

Build:
DEFAULT BRANCH: master
Ran 26 Oct 2022 10:38PM UTC
Jobs 1
Files 73
Run time 3s
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
#977

push

github-actions

web-flow
Add support for boolean constraints (about nullness) in Contract annotations (#669)

For example, the following method will behave equivalently to guava `Preconditions.checkState` with regards to null checks:
```java
@Contract("false -> fail")
static void check(boolean pass) {
  if (!pass) throw new RuntimeException();
}
```

This implementation works in a couple of layers:
- Firstly, contracts with a single boolean resultin in failure are handled by inserting a conditional throw node inline following the annotated method. This provides support for complex boolean logic input validateion.
- Secondly, simple null equal-to and not-equal-to checks are handled by the existing ContractHandler. These don't support such complex inputs, however they are able to work correctly with boolean outputs rather than exclusively `fail` cases.

I've updated the ContractHandler to use more precise language around antecedent nullness, previously null antecedents were described as nullable where cases required null. Please let me know if I've misunderstood the logic, but re-framing the values helped me to understand the logic.

5036 of 5431 relevant lines covered (92.73%)

0.93 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #977.1 26 Oct 2022 10:38PM UTC 0
92.73
Source Files on build #977
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #977
  • e004e43d 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