Skip to content
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: Adjust the prioritisation between MaD and source dispatch. #11392

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aschackmull
Copy link
Contributor

@aschackmull aschackmull commented Nov 23, 2022

When we have a combination of a good manual model for a callable and low confidence in the virtual dispatch to source targets, then we want to only use the model and disregard the source dispatch.
Selecting these cases involves a good deal of heuristics, and this PR tweaks this by allowing source dispatch to implementations of interfaces (with suitable flow models) unless those interfaces are from a different project, i.e. typically some interface in a library that the code depends on.
The reasoning is that if a library interface has flow models then it's likely because it comes with typically used default implementations of that interface, which makes any custom implementations unlikely dispatch targets if we don't have other indications that such a custom implementation might be in use at the call site.
Within a library that defines an interface, source dispatch happens as usual with the exception of a selection of core jdk interfaces for which we always want to use the flow models.

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Nov 23, 2022
@aschackmull aschackmull requested a review from a team as a code owner Nov 23, 2022
@github-actions github-actions bot added the Java label Nov 23, 2022
Copy link
Contributor

@atorralba atorralba left a comment

Happy to get this merged if DCA agrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants