C#: Replace all uses of the deprecated hasQualifiedName/1 predicate.

This commit is contained in:
Michael Nebel
2022-11-08 13:28:30 +01:00
parent 315a3a5ed3
commit c24302bec2
140 changed files with 372 additions and 313 deletions

View File

@@ -10,5 +10,5 @@
import csharp
from CatchClause catch
where catch.getCaughtExceptionType().hasQualifiedName("System.IO.IOException")
where catch.getCaughtExceptionType().hasQualifiedName("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().hasQualifiedName("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+().hasQualifiedName("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().hasQualifiedName("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().hasQualifiedName("Company", "Class")
select call

View File

@@ -17,6 +17,6 @@ where
add.hasName("Add") and
add.getDeclaringType()
.getUnboundDeclaration()
.hasQualifiedName("System.Collections.Generic.ICollection<>") and
.hasQualifiedName("System.Collections.Generic", "ICollection<>") 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().hasQualifiedName("System", "Object") and
base.getAnOverrider() = override
select override

View File

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