CodeQL library for Java/Kotlin
codeql/java-all 5.0.1-dev (changelog, source)
Search

Module DispatchImpl

Import path

import semmle.code.java.dataflow.internal.DataFlowDispatch

Predicates

mayBenefitFromCallContext

Holds if the set of viable implementations that can be called by call might be improved by knowing the call context. This is the case if the qualifier is a parameter of the enclosing callable of call.

parameterMatch

Holds if arguments at position apos match parameters at position ppos.

viableCallable

Gets a viable implementation of the target of the given Call. The following heuristic is applied for finding the appropriate callable: In general, dispatch to both any existing model and any viable source dispatch. However, if the model is generated and the static call target is in the source then we trust the source more than the model and skip dispatch to the model. Vice versa, if the model is manual and the source dispatch has a comparatively low confidence then we only dispatch to the model. Additionally, manual models that match a source dispatch exactly take precedence over the source.

viableImplInCallContext

Gets a viable dispatch target of call in the context ctx. This is restricted to those calls for which a context might make a difference.

Classes

ArgumentPosition

An argument position represented by an integer.

ParameterPosition

A parameter position represented by an integer.