C#: Use {get,has}FullyQualifiedName throughout

This commit is contained in:
Tom Hvitved
2023-10-25 14:28:43 +02:00
parent 66dc5501e8
commit b72f34591d
242 changed files with 565 additions and 517 deletions

View File

@@ -10,5 +10,5 @@
import csharp
from CatchClause catch
where catch.getCaughtExceptionType().hasQualifiedName("System.IO", "IOException")
where catch.getCaughtExceptionType().hasFullyQualifiedName("System.IO", "IOException")
select catch

View File

@@ -10,5 +10,5 @@
import csharp
from ObjectCreation new
where new.getObjectType().hasQualifiedName("System", "Exception")
where new.getObjectType().hasFullyQualifiedName("System", "Exception")
select new

View File

@@ -13,5 +13,5 @@
import csharp
from RefType type
where type.getABaseType+().hasQualifiedName("System.Collections", "IEnumerator")
where type.getABaseType+().hasFullyQualifiedName("System.Collections", "IEnumerator")
select type

View File

@@ -11,6 +11,6 @@ import csharp
from Field f, FieldRead read
where
f.hasName("VirtualAddress") and
f.getDeclaringType().hasQualifiedName("Mono.Cecil.PE", "Section") and
f.getDeclaringType().hasFullyQualifiedName("Mono.Cecil.PE", "Section") and
f = read.getTarget()
select read

View File

@@ -12,5 +12,5 @@ from MethodCall call, Method method
where
call.getTarget() = method and
method.hasName("MethodName") and
method.getDeclaringType().hasQualifiedName("Company", "Class")
method.getDeclaringType().hasFullyQualifiedName("Company", "Class")
select call

View File

@@ -17,6 +17,6 @@ where
add.hasName("Add") and
add.getDeclaringType()
.getUnboundDeclaration()
.hasQualifiedName("System.Collections.Generic", "ICollection<>") and
.hasFullyQualifiedName("System.Collections.Generic", "ICollection`1") and
call.getAnArgument() instanceof NullLiteral
select call

View File

@@ -11,6 +11,6 @@ import csharp
from Method override, Method base
where
base.hasName("ToString") and
base.getDeclaringType().hasQualifiedName("System", "Object") and
base.getDeclaringType().hasFullyQualifiedName("System", "Object") and
base.getAnOverrider() = override
select override

View File

@@ -9,5 +9,6 @@
import csharp
from ThrowStmt throw
where throw.getThrownExceptionType().getBaseClass*().hasQualifiedName("System.IO", "IOException")
where
throw.getThrownExceptionType().getBaseClass*().hasFullyQualifiedName("System.IO", "IOException")
select throw