Skip to content

Commit 09c64e8

Browse files
author
Stephan Brandauer
committed
Java: Support Argument[this] in framework mode metadata extraction
1 parent 499bd97 commit 09c64e8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

java/ql/src/Telemetry/AutomodelFrameworkModeCharacteristics.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,19 @@ class FrameworkModeMetadataExtractor extends string {
125125
string input, string parameterName
126126
) {
127127
exists(Callable callable, int paramIdx |
128-
e.asParameter() = callable.getParameter(paramIdx) and
128+
(
129+
e.(DataFlow::ExplicitParameterNode).asParameter() = callable.getParameter(paramIdx) and
130+
parameterName = e.asParameter().getName()
131+
or
132+
e.(DataFlow::InstanceParameterNode).getCallable() = callable and
133+
paramIdx = -1 and
134+
parameterName = "this"
135+
) and
129136
input = AutomodelJavaUtil::getArgumentForIndex(paramIdx) and
130137
package = callable.getDeclaringType().getPackage().getName() and
131138
type = callable.getDeclaringType().getErasure().(RefType).nestedName() and
132139
subtypes = AutomodelJavaUtil::considerSubtypes(callable).toString() and
133140
name = callable.getName() and
134-
parameterName = e.asParameter().getName() and
135141
signature = ExternalFlow::paramsString(callable)
136142
)
137143
}

0 commit comments

Comments
 (0)