Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External Library Models: Adding support for Nullable upper bounds of Generic Type parameters #949
External Library Models: Adding support for Nullable upper bounds of Generic Type parameters #949
Changes from 12 commits
628683b
0c4d694
ddaa68a
d351cc9
c3c37b0
8c48d3c
a28fa1c
c1e7097
6cab303
7d833db
9b63aa7
d679ed0
4186ca7
f369817
95b0cd0
99421aa
a190b9f
6220744
4f81dc0
71ce2e2
3f4c3e4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 75 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L73-L75
Check warning on line 93 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L93
Check warning on line 146 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L145-L146
Check warning on line 176 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L176
Check warning on line 178 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L178
Check warning on line 211 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L211
Check warning on line 213 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L213
Check warning on line 291 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L290-L291
Check warning on line 293 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L293
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need logic here like we have in the
isAnnotationNullable
method, to handle fully-qualified annotations?Check warning on line 296 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L296
Check warning on line 298 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L298
Check warning on line 300 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/LibraryModelGenerator.java#L300
Check warning on line 128 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/StubxWriter.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/StubxWriter.java#L127-L128
Check warning on line 134 in library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/StubxWriter.java
Codecov / codecov/patch
library-model/library-model-generator/src/main/java/com/uber/nullaway/libmodel/StubxWriter.java#L131-L134
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit weird since the method always returns
null
, so the return type should really be@Nullable T
. Maybe, for readability, rewrite this class to have a public@Nullable
field and return that field fromgetNull()
? And maybe rename togetNullable()
? Same changes in the annotated versionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the return type of the method be
@Nullable T
in the unannotated version as well or only in the annotated version?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not suggesting to change the return type to
@Nullable T
. I'm suggesting to have a field of typeT
and to return the value of that field, rather than just returningnull
. Then the return typeT
would be appropriate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that makes sense, thanks!