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

Track access paths of the form `Foo.this.bar` #937

Closed msridhar closed 6 months ago

msridhar commented 6 months ago

Fixes #936

We add limited tracking of such access paths, to handle null checks on fields from an enclosing class of a nested class.

msridhar commented 6 months ago

/benchmark

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 87.04%. Comparing base (3bde26c) to head (3c8ff10).

Files Patch % Lines
...in/java/com/uber/nullaway/dataflow/AccessPath.java 85.71% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #937 +/- ## ============================================ - Coverage 87.04% 87.04% -0.01% - Complexity 1993 1995 +2 ============================================ Files 77 77 Lines 6440 6447 +7 Branches 1249 1252 +3 ============================================ + Hits 5606 5612 +6 Misses 422 422 - Partials 412 413 +1 ```

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

github-actions[bot] commented 6 months ago

Main Branch:

Benchmark                          Mode  Cnt   Score   Error  Units
AutodisposeBenchmark.compile      thrpt   25   9.212 ± 0.074  ops/s
CaffeineBenchmark.compile         thrpt   25   2.122 ± 0.023  ops/s
DFlowMicroBenchmark.compile       thrpt   25  25.144 ± 0.348  ops/s
NullawayReleaseBenchmark.compile  thrpt   25   1.283 ± 0.020  ops/s

With This PR:

Benchmark                          Mode  Cnt   Score   Error  Units
AutodisposeBenchmark.compile      thrpt   25   9.264 ± 0.093  ops/s
CaffeineBenchmark.compile         thrpt   25   2.120 ± 0.025  ops/s
DFlowMicroBenchmark.compile       thrpt   25  24.611 ± 0.319  ops/s
NullawayReleaseBenchmark.compile  thrpt   25   1.271 ± 0.018  ops/s