Skip to content

Commit e8595e2

Browse files
Update java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll
Co-authored-by: Anders Schack-Mulligen <[email protected]>
1 parent 15b0690 commit e8595e2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ private module DispatchImpl {
4343
/**
4444
* Gets a viable implementation of the target of the given `Call`.
4545
* The following heuristic is applied for finding the appropriate callable:
46-
* 1. If an exact manual model exists, only dispatch to the summarized callable.
47-
* 2. If a (non exact) manual model exists and/or if the source code is available, dispatch to both/either.
48-
* 3. Only dispatch to a summarized callable in case the static call target in not in source.
46+
* In general, dispatch to both any existing model and any viable source dispatch.
47+
* However, if the model is generated and the static call target is in the source then
48+
* we trust the source more than the model and skip dispatch to the model.
49+
* Vice versa, if the model is manual and the source dispatch has a comparatively low
50+
* confidence then we only dispatch to the model. Additionally, manual models that
51+
* match a source dispatch exactly take precedence over the source.
4952
*/
5053
DataFlowCallable viableCallable(DataFlowCall c) {
5154
exists(Call call | call = c.asCall() |

0 commit comments

Comments
 (0)