uber / NullAway

A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead
MIT License
3.63k stars 293 forks source link

Handle methods that fail unconditionally in ContractHandler #946

Closed msridhar closed 6 months ago

msridhar commented 6 months ago

Fixes #943

We extend ContractHandler to insert an unconditional throw into the CFG when encountering a method that fails unconditionally according to its @Contract annotation.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 93.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 87.06%. Comparing base (76f0f77) to head (a794043).

:exclamation: Current head a794043 differs from pull request most recent head b48e7a8. Consider uploading reports for the commit b48e7a8 to get more accurate results

Files Patch % Lines
...uber/nullaway/dataflow/cfg/NullAwayCFGBuilder.java 88.88% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #946 +/- ## ============================================ - Coverage 87.13% 87.06% -0.07% + Complexity 2011 1995 -16 ============================================ Files 78 77 -1 Lines 6513 6456 -57 Branches 1264 1253 -11 ============================================ - Hits 5675 5621 -54 Misses 422 422 + Partials 416 413 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.