mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Improve IterableType implementation.
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
This commit is contained in:
@@ -12,9 +12,9 @@ private class IterableType extends Class {
|
|||||||
private Type elementType;
|
private Type elementType;
|
||||||
|
|
||||||
IterableType() {
|
IterableType() {
|
||||||
exists(Method m, Type return, GenericType t, Type et, int position | m.getDeclaringType() = t |
|
exists(Method m, RefType return, GenericType t, Type et, int position | m.getDeclaringType() = t |
|
||||||
return = m.getReturnType() and
|
return = m.getReturnType() and
|
||||||
return.getName().matches("Iterator%") and
|
return.getSourceDeclaration().hasQualifiedName("java.util", "Iterator") and
|
||||||
et = return.(ParameterizedType).getTypeArgument(0) and
|
et = return.(ParameterizedType).getTypeArgument(0) and
|
||||||
t.getTypeParameter(position) = et and
|
t.getTypeParameter(position) = et and
|
||||||
instantiates(this, t, position, elementType)
|
instantiates(this, t, position, elementType)
|
||||||
|
|||||||
Reference in New Issue
Block a user