NullAway
NullAway copied to clipboard
External Library Models: Adding support for Nullable upper bounds of Generic Type parameters
With these changes we are able to read and create library models for Nullable upper bounds of generic type parameters from externally annotated source code as shown in the below example.
Externally annotated source code example:
public static class GenericExample<T extends @Nullable Object> {
public T getNull() {
return null;
}
}
public static class GenericExample<T> {
public T getNull() {
return null;
}
}
static GenericExample<@Nullable Object> genericExample = new GenericExample<@Nullable Object>();
static void test(Object value){}
// BUG: Diagnostic contains: passing @Nullable parameter 'genericExample.getNull()'
test(genericExample.getNull());
Codecov Report
Attention: Patch coverage is 66.90647% with 46 lines in your changes missing coverage. Please review.
Project coverage is 85.97%. Comparing base (
6cec433) to head (71ce2e2).
:exclamation: Current head 71ce2e2 differs from pull request most recent head 3f4c3e4
Please upload reports for the commit 3f4c3e4 to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## master #949 +/- ##
============================================
- Coverage 86.17% 85.97% -0.20%
- Complexity 2037 2046 +9
============================================
Files 81 82 +1
Lines 6691 6760 +69
Branches 1290 1301 +11
============================================
+ Hits 5766 5812 +46
- Misses 515 536 +21
- Partials 410 412 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.