Skip to content

Commit 8c1de59

Browse files
committed
Java: Make better QL docs and add some missing 'this'.
1 parent b80c533 commit 8c1de59

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

java/ql/lib/semmle/code/java/Collections.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java
77

88
/**
9-
* The type `t` is a parameterization of `g`, where the `i`-th type parameter of
9+
* Holds if the type `t` is a parameterization of `g`, where the `i`-th type parameter of
1010
* `g` is instantiated to `arg`.
1111
*
1212
* For example, `List<Integer>` parameterizes `List<T>`, instantiating its `0`-th

java/ql/src/utils/model-generator/internal/CaptureTypeBasedSummaryModels.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ private class Function extends ParameterizedType {
138138

139139
Function() { fi = this.getGenericType() }
140140

141+
/**
142+
* Gets the typevariable that is the placeholder for the type `t`
143+
* used in the instantiation of `this`.
144+
*/
141145
private TypeVariable getTypeReplacement(Type t) {
142146
exists(int position |
143147
instantiates(this, fi, position, t) and
@@ -151,7 +155,7 @@ private class Function extends ParameterizedType {
151155
*/
152156
Type getParameterType(int position) {
153157
exists(Type t |
154-
fi.getRunMethod().getParameterType(position) = getTypeReplacement(t) and
158+
fi.getRunMethod().getParameterType(position) = this.getTypeReplacement(t) and
155159
isEffectivelyLowerBound(t, result)
156160
)
157161
}
@@ -162,7 +166,7 @@ private class Function extends ParameterizedType {
162166
*/
163167
Type getReturnType() {
164168
exists(Type t |
165-
fi.getRunMethod().getReturnType() = getTypeReplacement(t) and
169+
fi.getRunMethod().getReturnType() = this.getTypeReplacement(t) and
166170
isEffectivelyUpperBound(t, result)
167171
)
168172
}

0 commit comments

Comments
 (0)