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

JSpecify subtyping checks for arrays #956

Closed msridhar closed 5 months ago

msridhar commented 5 months ago

Add checks for proper array subtyping (including nullability of array contents) at pseudo-assignments and for method overriding. We do not yet handle multi-dimensional arrays. Note that JSpecify allows for covariant array subtyping with respect to nullability (see https://github.com/jspecify/jspecify/issues/65) which complicates the implementation a bit. Also some hacks are required since javac does not propagate the array contents nullability annotation into the types of the relevant trees in all cases.

codecov[bot] commented 5 months ago

Codecov Report

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

Project coverage is 86.12%. Comparing base (f4c4734) to head (075fa41).

Files Patch % Lines
...ava/com/uber/nullaway/generics/GenericsChecks.java 96.22% 0 Missing and 2 partials :warning:
...away/src/main/java/com/uber/nullaway/NullAway.java 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #956 +/- ## ============================================ + Coverage 86.06% 86.12% +0.06% - Complexity 2027 2040 +13 ============================================ Files 81 81 Lines 6679 6708 +29 Branches 1287 1293 +6 ============================================ + Hits 5748 5777 +29 Misses 518 518 Partials 413 413 ```

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