mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +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;
|
||||
|
||||
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.getName().matches("Iterator%") and
|
||||
return.getSourceDeclaration().hasQualifiedName("java.util", "Iterator") and
|
||||
et = return.(ParameterizedType).getTypeArgument(0) and
|
||||
t.getTypeParameter(position) = et and
|
||||
instantiates(this, t, position, elementType)
|
||||
|
||||
Reference in New Issue
Block a user