mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Replace all uses of the deprecated hasQualifiedName/1 predicate.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -10,5 +10,5 @@
|
||||
import csharp
|
||||
|
||||
from ObjectCreation new
|
||||
where new.getObjectType().hasQualifiedName("System.Exception")
|
||||
where new.getObjectType().hasQualifiedName("System", "Exception")
|
||||
select new
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user