-
Notifications
You must be signed in to change notification settings - Fork 299
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
JSpecify generics checks for conditional expressions #739
Merged
msridhar
merged 246 commits into
uber:master
from
NikitaAware:generics-ternary-operator-assignment-changes
Mar 9, 2023
Merged
Changes from 245 commits
Commits
Show all changes
246 commits
Select commit
Hold shift + click to select a range
f306db2
an initial test case
msridhar 16654f7
sample code
msridhar 7f9418b
add-generics-checks
NikitaAware 441ab7c
first-case-of-generics-support
NikitaAware 4a9c86d
first-case-of-generics-support
NikitaAware 01377b6
restore bad deletion
msridhar 359dcc8
add-generics-spport-task-1-updates
NikitaAware 731bf3d
add-generics-spport-task-1-updates
NikitaAware b9b8239
add-generics-spport-task-1-updates
NikitaAware fb1beb9
add generics check for variables
NikitaAware 1a23f8e
Merge branch 'master' into add-generics-checks
msridhar 90d471d
tweak error message
msridhar 98f7fa6
more tests
msridhar 53ddad7
code cleanup.remove print statements
NikitaAware 7daa52b
Add temporary check to consider unannoted base type
NikitaAware cd01ff9
minor code changes
NikitaAware 202d5db
add generics check for new class - check if the class is generic
NikitaAware 3998949
add generics check for new class - check for the type arguments
NikitaAware fc8b99f
generics check for new class
NikitaAware 6425909
generics check for extended class
NikitaAware bae84dc
generics check for new class
NikitaAware 4aba42c
generics check for new class - minor changes for error message
NikitaAware bca4f24
generics check for interface implementation
NikitaAware 99e8bf9
minor identation changes
NikitaAware a0caac8
nullability checks for build failures
NikitaAware 5b9d918
Add Test: generics check for subclasses
NikitaAware 4cb51d9
restructure generics tests
NikitaAware 2e4a2ef
restructure generics tests
NikitaAware b1668e9
Add tests
NikitaAware 9c8b3ae
restructure code
NikitaAware 97e088b
restructure code
NikitaAware 036febf
restructure code
NikitaAware f065bd9
Merge branch 'master' into add-generics-checks
msridhar 00ad702
add jspecify mode flag
msridhar 31a0e4d
check jspecify flag
msridhar fe66b4a
add test case for nested type parameter instantiation
msridhar 89ca225
nested type
NikitaAware 8ba736b
nested generics type check for new class
NikitaAware fa627be
Add test - generics check for function return type
NikitaAware 5745cf7
Add - generics check for function return type
NikitaAware 1518629
code cleaning - generics check
NikitaAware b25ba39
code cleaning - generics check
NikitaAware bd96079
Merge branch 'master' into add-generics-checks
msridhar 975dccd
Suggested changes
NikitaAware 6d22b00
Suggested changes
NikitaAware 2ddbea9
Suggested changes
NikitaAware b9cbbff
working changes
NikitaAware 2002aec
working changes
NikitaAware 5c11fbe
suggested changes
NikitaAware 736a613
suggested changes
NikitaAware 80ba7a5
suggested changes
NikitaAware e1864ee
suggested changes
NikitaAware 8d5e193
extend test
msridhar 91aab18
@Nullable annotation check for Paramterized typed tree
NikitaAware 799f5dc
@Nullable annotation check for Paramterized typed tree
NikitaAware f042e60
added updates
NikitaAware 852e4b1
added updates
NikitaAware 8b484c2
extra test cases for other annotations
NikitaAware 1727458
extra test cases for other annotations
NikitaAware 7ecc2c4
Merge branch 'master' into add-generics-checks
NikitaAware f0a0b62
some comments and a todo
msridhar bc3c0be
reuse code
msridhar 832f733
minor cleanup
msridhar 0b5268c
fix
msridhar 66a1068
Suggested changes
NikitaAware 1bc1ea6
Suggested changes
NikitaAware cb1690a
Suggested changes
NikitaAware c523f2d
Javadoc tweaks
msridhar 8cf3819
add private constructor
msridhar 27d5488
suggested changes
NikitaAware 263edac
suggested changes
NikitaAware 2fa8569
suggested changes
NikitaAware f40a0da
suggested changes
NikitaAware 8308cf6
code cleanup
msridhar af6404a
tests for error positions
msridhar ad67e01
Clean up by implementing ParameterizedTypeTreeMatcher
msridhar 67994da
remove extra blank line
msridhar 2631d63
add test
msridhar 36a5c60
suggested changes
NikitaAware c8ebfe6
suggested changes
NikitaAware 938c595
Merge branch 'master' into add-generics-checks
msridhar 3fb6856
tweak error message
msridhar ee57c56
clarify test name and purpose
msridhar 7349744
Assignment interface added
NikitaAware b5eb8a0
structure for assignments checks
NikitaAware eecc4c3
Assignment changes
NikitaAware 063c580
supertype changes
NikitaAware 696aa90
Merge branch 'master' into assigments1
NikitaAware 823da48
multiple interface implementation
NikitaAware e26e088
multilevel inheritance
NikitaAware f7009ae
changes
NikitaAware 3b2cdf1
changes
NikitaAware d957f56
nested checks
NikitaAware 2d061fc
working changes
NikitaAware 80f296e
working changes
NikitaAware c33fe3f
Working changes
NikitaAware 31a3dca
updates
NikitaAware 3eca5a3
failing 3 tests
NikitaAware 3435f89
working tests
NikitaAware 7972c05
npe for variable initialization changes
NikitaAware 4924722
npe for variable initialization changes
NikitaAware 35e2bc7
All tests pass including the existing tests
NikitaAware a59d223
Merge branch 'master' into assigments1
msridhar 25b840b
Merge branch 'master' into assigments1
msridhar c8456f3
some cleanup
msridhar 945df87
enable check for multiple top-level classes
msridhar a3fa869
suggested changes - enclosing class member fields
NikitaAware 601f2b5
code cleanup
NikitaAware a0aacdb
suggested changes
NikitaAware 7b39522
Merge branch 'master' into assigments1
msridhar 84140d0
some suggested changes
NikitaAware 20fae01
suggested changes with working normal typed tree
NikitaAware c517b4b
Changes with parameterized typed tree without the error generation
NikitaAware def7ce2
suggested changes with two test cases failing
NikitaAware 75f36df
suggested changes with all passing tests
NikitaAware 0125647
All working changes
NikitaAware 8fc5d18
Continuous integration working
NikitaAware 090ac0c
Continuous integration working
NikitaAware ba6b229
changes
NikitaAware bd6700f
minor changes
NikitaAware fd0b096
fix naming case
msridhar d5f34f2
failing test
msridhar 01c5503
refactoring and comments
msridhar 25599dd
add a case
msridhar bf80848
working code with class type
NikitaAware 8ca41d0
minor refactoring
NikitaAware 4a87b6c
minor changes
NikitaAware 44bea9b
code cleaning
NikitaAware b9a2ed4
code cleaning
NikitaAware ac7f33a
fancy test works!
msridhar 851fbfa
Merge branch 'master' into assigments1
msridhar b1119ab
only run check in JSpecify mode
msridhar 92989ec
Fix NullAway errors
msridhar 334d1e8
modified assignment message
NikitaAware 79b474b
remove unneeded suppression
msridhar 05292c0
remove change to build.gradle
msridhar d9e2689
remove local used only once
msridhar 1cc72f2
cleanup supertypeMatchingLHS
msridhar 85741be
restore private
msridhar c58d819
add private
msridhar 8829bcd
changed the error message
NikitaAware fd16446
updated the error message text
NikitaAware c0fd28e
Type.ClassType suggestion changes
NikitaAware abe3ed9
changes
NikitaAware 7a18462
changes
NikitaAware 23c8fbb
changes
NikitaAware 88accab
extra test case
NikitaAware 124e7c8
add failing test
msridhar 00802a1
updated logic
NikitaAware 021435a
minor updates
NikitaAware a12d549
minor code cleaning
NikitaAware 82d9e8d
minor code cleaning
NikitaAware f381d83
suggested changes
NikitaAware 75234b8
suggested changes
NikitaAware 1be7c40
replaced super type matching lhs with asSuper method
NikitaAware 676e07d
updated assignment checks
NikitaAware a085443
changes
NikitaAware c8303d7
changes
NikitaAware 4238a9a
suggested changes
NikitaAware f5ec4cd
suggested changes
NikitaAware 257c42c
suggested changes
NikitaAware a9e4890
suggested changes
NikitaAware f3fd30d
suggested changes
NikitaAware c2f66e2
Merge branch 'master' into assigments1
msridhar aeddd14
fix nullaway error
msridhar c67db12
Merge branch 'master' into assigments1
msridhar e244e55
fixes
msridhar 53f8546
more cleanup and javadoc
msridhar 0fe788d
Merge branch 'master' into assigments1
msridhar 3fb81c9
Merge branch 'master' into assigments1
msridhar 0bfe208
Merge branch 'master' into assigments1
msridhar d6bc810
suggested changes in test nestedChecksForAssignmentsMultipleArguments
NikitaAware 3127339
suggested changes in test - superTypeAssignmentChecksSingleInterface
NikitaAware 4aacb5a
suggested indentation changes in test - superTypeAssignmentChecksMult…
NikitaAware f3e6b45
suggested changes
NikitaAware 38f2ef6
suggested changes
NikitaAware 5245c4d
suggested test for the lambda expressions
NikitaAware 0344360
Java doc for type with preserved annotations
NikitaAware 00cad6f
comments
NikitaAware d09c190
code cleaning for the tests
NikitaAware 8bb552c
code cleaning for the tests
NikitaAware 0cff82f
changes
NikitaAware 9906f25
suggested changes
NikitaAware f6dcc69
negative tests
NikitaAware 4323d48
fix formatting in tests
msridhar 5ec8fa1
test cases for diamond operator and the lambdas
NikitaAware 7c07d98
test cases for diamond operator and the lambdas
NikitaAware 6755d66
private fields
NikitaAware 41f45b1
check only for jspecify nullable annotation
NikitaAware 322c3c2
move test method to more appropriate place
msridhar 4a46a46
tweak method reference test
msridhar 4a1ce05
re-add blank line
msridhar fce345b
clarify method ref test
msridhar 02bbd9f
tweak lambda and diamond operator tests
msridhar 514829d
make test Java 8 compatible
msridhar 2270d8d
Merge branch 'master' into assigments1
msridhar 924883b
Merge branch 'master' into assigments1
msridhar c070c22
Merge branch 'master' into assigments1
msridhar e37aa61
Merge branch 'master' into assigments1
msridhar 7412439
suggested changes
NikitaAware 228cf0f
suggested changes
NikitaAware b7bbf7c
suggested changes
NikitaAware edb4f86
suggested changes
NikitaAware 18f3134
Merge branch 'master' into assigments1
lazaroclapp 49a113f
function call
NikitaAware bb9212e
function changes
NikitaAware bb246e2
tests
NikitaAware 410c130
tests
NikitaAware de0ca7f
funtions
NikitaAware 105f557
changes
NikitaAware 1490648
fix bad diff with master
msridhar 38429d4
Merge branch 'master' into generics-return-type-changes
msridhar 40ffe4e
Merge branch 'generics-return-type-changes' into generics-ternary-ope…
msridhar f03bb05
fix nullaway warning
msridhar 51b351f
fix tests
msridhar 309db13
Merge branch 'generics-return-type-changes' into generics-ternary-ope…
msridhar 52825a2
fix
msridhar b4982ea
change approach
msridhar 6493985
add another test case
msridhar 76093ab
suggested changes
NikitaAware ea40f7d
suggested changes
NikitaAware 824ed42
error message return changes
NikitaAware 4651fe9
suggested changes
NikitaAware 1921bd1
suggested changes
NikitaAware 090fd56
suggested changes
NikitaAware 6dde586
Merge branch 'generics-return-type-changes' into generics-ternary-ope…
msridhar e8ff4b3
Update nullaway/src/main/java/com/uber/nullaway/GenericsChecks.java
NikitaAware 142a820
updated error message
NikitaAware 5344b5b
updated error message
NikitaAware b37c0ab
updated error message
NikitaAware afcf86e
Merge branch 'generics-return-type-changes' into generics-ternary-ope…
msridhar 4fe9435
updated error message
NikitaAware d8fae04
update method name
NikitaAware cbda35b
javadoc
NikitaAware cd8c8e2
updated error message
NikitaAware fbc7ed7
updated error message
NikitaAware f73b54c
suggested changes
NikitaAware 64b9be0
Update nullaway/src/main/java/com/uber/nullaway/GenericsChecks.java
NikitaAware 07dca0a
formatting
msridhar 6287e96
clarify docs and add test
msridhar 4820854
Merge branch 'master' into generics-ternary-operator-assignment-changes
msridhar dc232c9
minor changes in a test case
NikitaAware 6fae455
Merge branch 'master' into generics-ternary-operator-assignment-changes
msridhar 91e0b36
Merge branch 'master' into generics-ternary-operator-assignment-changes
msridhar db03146
Merge branch 'master' into generics-ternary-operator-assignment-changes
msridhar 5a3dcf3
Merge branch 'master' into generics-ternary-operator-assignment-changes
msridhar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Couldn't we avoid the repeated error message of test
ternaryMismatchedAssignmentContext
simply by adding an early return here? What am I missing?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.
You're right that we could early return and only report one error there. However, I think what we would really want for that test case is an error message saying the conditional expression as a whole has type
A<String>
, but the context (i.e., the left-hand side of the assignment) requires typeA<@Nullable String>
which is mismatched. If we early return, we will report the error for the true part of the conditional expression, but not for the expression as a whole, which I think is still not ideal. If you think just reporting for the true part is better than what we do now, we can add the early return.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.
Makes sense to keep this as is for now and working on a better reporting location as a follow up, then, I think...