-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description of the issue
The JLS defines "fully qualified name" as:
The fully qualified name of a top level class or top level interface that is declared in a named package consists of the fully qualified name of the package, followed by ".", followed by the simple name of the class or interface.
[...]
The fully qualified name of the interfaceEnumeration, which is defined in the packagejava.util, is "java.util.Enumeration".
[...]
A local class or anonymous class does not have a fully qualified name.
So the qualified name does not include type parameters.
However, QL's
RefType.getQualifiedNameRefType.hasQualifiedName
can contain type parameters and even type arguments and return results for local and anonymous classes.
This is not obvious from the documentation of these methods (except when looking at AnonymousClass::getQualifiedName, though a caller of RefType::getQualifiedName likely does not do that) so it would be good to add that.
Example query:
import java
from MethodAccess call
where
call.getReceiverType().hasQualifiedName("java.util", "List<String>")
select call