Skip to content

Allowing NewClassTree to be passed into getGenericParameterNullnessAtInvocation#1210

Merged
msridhar merged 14 commits intouber:masterfrom
dhruv-agr:issue-1155
May 10, 2025
Merged

Allowing NewClassTree to be passed into getGenericParameterNullnessAtInvocation#1210
msridhar merged 14 commits intouber:masterfrom
dhruv-agr:issue-1155

Conversation

@dhruv-agr
Copy link
Copy Markdown
Contributor

@dhruv-agr dhruv-agr commented May 2, 2025

unit test: newNullableWithArg()

Generalised the parameters of getGenericParameterNullnessAtInvocation to accept NewClassTree

Fixes #1214

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 2, 2025

CLA assistant check
All committers have signed the CLA.

@msridhar msridhar changed the base branch from issue-1155 to master May 4, 2025 19:04
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2025

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.29%. Comparing base (b9815a6) to head (bdafabe).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...away/src/main/java/com/uber/nullaway/NullAway.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1210   +/-   ##
=========================================
  Coverage     88.28%   88.29%           
- Complexity     2344     2347    +3     
=========================================
  Files            89       89           
  Lines          7643     7652    +9     
  Branches       1528     1531    +3     
=========================================
+ Hits           6748     6756    +8     
  Misses          450      450           
- Partials        445      446    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@msridhar msridhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I have a few comments

Comment thread nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java Outdated
Comment thread nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java Outdated
.doTest();
}

@Ignore
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have an issue now where we track this case?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not addressed

msridhar and others added 10 commits May 9, 2025 00:36
…ber#1197)

Fixes uber#1194 

Previously we were sloppy about allowing a null `Handler` to be passed
into `CodeAnnotationInfo` and then caching the result. Here we change
the code to always pass a non-null `Handler` in to public APIs of
`CodeAnnotationInfo`, and we avoid caching if the handler is ever `null`
from an internal call.
…1200)

Partially addresses uber#1199. After substituting for a type variable, we
were not retrieving the correct nullability for a varargs parameter,
which should be the nullability of the component, not the array type
itself.

Also adds some simplification of our handling of varargs calls based on
a tip from @jeffrey-easyesi
…1204)

Small optimization over uber#1203; pre-compile the `Pattern` used for
matching.
Fixes uber#1195 

We adjust our method overriding checks for a method reference to a
`@NullUnmarked` method. Any overriding should be allowed, except in the
presence of a restrictive annotation (`@Nullable` on the return or
`@NonNull` on a parameter). Also add tests for `@NonNull` on the varargs
parameter.
@msridhar msridhar marked this pull request as ready for review May 10, 2025 20:17
Copy link
Copy Markdown
Collaborator

@msridhar msridhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@msridhar msridhar enabled auto-merge (squash) May 10, 2025 20:18
@msridhar msridhar merged commit 56c7f2b into uber:master May 10, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue passing @Nullable argument to constructor of generic type

4 participants