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

Support for extra Futures classes #909

Closed msridhar closed 8 months ago

msridhar commented 8 months ago

This allows for a list of classes to be passed in via a command-line argument -XepOpt:NullAway:ExtraFuturesClasses. Such classes will be treated equivalently to built-in Guava Futures classes via the FluentFutureHandler. This is a follow-up to #771.

codecov[bot] commented 8 months ago

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (3fc9b8a) 86.98% compared to head (e8127e5) 87.07%. Report is 4 commits behind head on master.

Files Patch % Lines
...c/main/java/com/uber/nullaway/NullabilityUtil.java 66.66% 1 Missing and 2 partials :warning:
...away/src/main/java/com/uber/nullaway/NullAway.java 93.75% 0 Missing and 2 partials :warning:
...ava/com/uber/nullaway/generics/GenericsChecks.java 88.88% 0 Missing and 2 partials :warning:
...src/main/java/com/uber/nullaway/LibraryModels.java 66.66% 1 Missing :warning:
...llaway/dataflow/AccessPathNullnessPropagation.java 85.71% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #909 +/- ## ============================================ + Coverage 86.98% 87.07% +0.09% - Complexity 1959 1989 +30 ============================================ Files 77 77 Lines 6330 6423 +93 Branches 1223 1244 +21 ============================================ + Hits 5506 5593 +87 - Misses 420 422 +2 - Partials 404 408 +4 ```

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

tbroyer commented 8 months ago

Could https://github.com/uber/NullAway/wiki/Configuration be updated? as 0.10.23 was released with this change (I generally copy the description to my Gradle plugin, to make sure I don't describe things wrong) TIA

msridhar commented 8 months ago

Thanks for the reminder! I've added docs here:

https://github.com/uber/NullAway/wiki/Configuration#extra-futures-classes

tbroyer commented 8 months ago

Thanks, just published version 2.0.0 of the plugin that adds support for this in the DSL (major version bump due to removing support for Gradle 5.2 → 6.7)