mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Make better QL docs and add some missing 'this'.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import java
|
||||
|
||||
/**
|
||||
* The type `t` is a parameterization of `g`, where the `i`-th type parameter of
|
||||
* Holds if the type `t` is a parameterization of `g`, where the `i`-th type parameter of
|
||||
* `g` is instantiated to `arg`.
|
||||
*
|
||||
* For example, `List<Integer>` parameterizes `List<T>`, instantiating its `0`-th
|
||||
|
||||
@@ -138,6 +138,10 @@ private class Function extends ParameterizedType {
|
||||
|
||||
Function() { fi = this.getGenericType() }
|
||||
|
||||
/**
|
||||
* Gets the typevariable that is the placeholder for the type `t`
|
||||
* used in the instantiation of `this`.
|
||||
*/
|
||||
private TypeVariable getTypeReplacement(Type t) {
|
||||
exists(int position |
|
||||
instantiates(this, fi, position, t) and
|
||||
@@ -151,7 +155,7 @@ private class Function extends ParameterizedType {
|
||||
*/
|
||||
Type getParameterType(int position) {
|
||||
exists(Type t |
|
||||
fi.getRunMethod().getParameterType(position) = getTypeReplacement(t) and
|
||||
fi.getRunMethod().getParameterType(position) = this.getTypeReplacement(t) and
|
||||
isEffectivelyLowerBound(t, result)
|
||||
)
|
||||
}
|
||||
@@ -162,7 +166,7 @@ private class Function extends ParameterizedType {
|
||||
*/
|
||||
Type getReturnType() {
|
||||
exists(Type t |
|
||||
fi.getRunMethod().getReturnType() = getTypeReplacement(t) and
|
||||
fi.getRunMethod().getReturnType() = this.getTypeReplacement(t) and
|
||||
isEffectivelyUpperBound(t, result)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user