-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Java: Fix WildcardTypeAccess.hasNoBound() not considering ArrayTypeAccess #5407
base: main
Are you sure you want to change the base?
Java: Fix WildcardTypeAccess.hasNoBound() not considering ArrayTypeAccess #5407
Conversation
else | ||
// Also makes sure that getBound() is working correctly (and has at most | ||
// one result) | ||
exists(Expr bound | bound = wta.getBound() and not wta.getBound() != bound | |
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.
exists(Expr bound | bound = wta.getBound() and not wta.getBound() != bound | | |
exists(Expr bound | bound = wta.getBound() | |
It's better to test the not-having-multiple-values by potentially observing those values rather than observing nothing.
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.
Though then the test would also succeed when getBound()
would have additionally completely unrelated results since here in the test its result is bound below with getUpperBound()
/ getLowerBound()
.
@@ -1742,11 +1742,27 @@ class WildcardTypeAccess extends Expr, @wildcardtypeaccess { | |||
/** Gets the lower bound of this wildcard type access, if any. */ | |||
Expr getLowerBound() { result.isNthChildOf(this, 1) } | |||
|
|||
/** | |||
* Gets the bound of this wildcard type access, if any, i.e. either the upper |
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 use abbreviations in qldoc.
* Gets the bound of this wildcard type access, if any, i.e. either the upper | |
* Gets the bound of this wildcard type access, if any, that is, either the upper |
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.
Made this a separate sentence ("... any. That is, ...") to be consistent with other comments and to not have so many commas.
(Though this might not be grammatically correct?)
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.
Some inline comments, otherwise LGTM.
|
Thanks for the feedback and sorry for the oversights. I assume the test failures came from a compilation error in the source test file; I overlooked this and CodeCLI was not failing locally for me (see #5476). I have addressed most of the feedback except the If you decide to merge this pull request, then please, in your own interest, squash the commits for a clean history on |
WildcardTypeAccess.getBound()
WildcardTypeAccess.toString()