-
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
C#/Java: Increase precision of model generation. #15179
Conversation
ce23bd0
to
0f05504
Compare
0f05504
to
d91e2c6
Compare
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.
Java LGTM
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.
Actually, for java, is this only considering default method bodies provided by interfaces? Because I think we want methods of any class implementing an interface. I've asked @jcogs33 to clarify.
d91e2c6
to
945bf78
Compare
DCA |
@@ -77,6 +77,6 @@ string captureFlow(DataFlowTargetApi api) { | |||
* A neutral model is generated, if there does not exist any summary model. |
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.
Please update this QLDoc to describe the new logic that you've added.
if exists(superImpl(api)) | ||
then superImpl(api).fromSource() and result = superImpl(api).getDeclaringType() | ||
else result = api.getDeclaringType() | ||
result = api.lift().getDeclaringType() |
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.
Just to check that I've understood correctly: this change does nothing, but the logic in lift
has been extracted to a predicate so it can be used somewhere else too.
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.
Correct.
@@ -0,0 +1,20 @@ | |||
package p; | |||
|
|||
class MultipleImpl2 { |
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 think it would be helpful for future readers of the code to add a comment explaining what intended behaviour this test is testing.
It isn't immediately obvious to me what the reasoning is for not generating a neutral summary when the default implementation of an interface method is trivial. |
Let's remove that again. The stuff we wanted was to avoid creating neutral summary models, if at least one implementation exhibited flow. |
19de2d5
to
37a21ec
Compare
Review comments addressed, rebased the PR to remove the undesired parts, description updated. |
This PR includes a couple of changes to the model generator.