mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
C#: Remove deprecated qualifiedName predicates.
This commit is contained in:
@@ -101,25 +101,6 @@ class NamedElement extends Element, @named_element {
|
|||||||
/** Holds if this element has name 'name'. */
|
/** Holds if this element has name 'name'. */
|
||||||
final predicate hasName(string name) { name = this.getName() }
|
final predicate hasName(string name) { name = this.getName() }
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the fully qualified name of this element, for example the
|
|
||||||
* fully qualified name of `M` on line 3 is `N.C.M` in
|
|
||||||
*
|
|
||||||
* ```csharp
|
|
||||||
* namespace N {
|
|
||||||
* class C {
|
|
||||||
* void M(int i, string s) { }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
cached
|
|
||||||
deprecated final string getQualifiedName() {
|
|
||||||
exists(string qualifier, string name | this.hasQualifiedName(qualifier, name) |
|
|
||||||
if qualifier = "" then result = name else result = qualifier + "." + name
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the fully qualified name of this element, for example the
|
* Gets the fully qualified name of this element, for example the
|
||||||
* fully qualified name of `M` on line 3 is `N.C.M` in
|
* fully qualified name of `M` on line 3 is `N.C.M` in
|
||||||
@@ -142,16 +123,6 @@ class NamedElement extends Element, @named_element {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* DEPRECATED: Use `hasFullyQualifiedName` instead.
|
|
||||||
*
|
|
||||||
* Holds if this element has the qualified name `qualifier`.`name`.
|
|
||||||
*/
|
|
||||||
cached
|
|
||||||
deprecated predicate hasQualifiedName(string qualifier, string name) {
|
|
||||||
qualifier = "" and name = this.getName()
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Holds if this element has the fully qualified name `qualifier`.`name`. */
|
/** Holds if this element has the fully qualified name `qualifier`.`name`. */
|
||||||
cached
|
cached
|
||||||
predicate hasFullyQualifiedName(string qualifier, string name) {
|
predicate hasFullyQualifiedName(string qualifier, string name) {
|
||||||
|
|||||||
@@ -71,37 +71,10 @@ class Declaration extends NamedElement, @declaration {
|
|||||||
|
|
||||||
override string toString() { result = this.getName() }
|
override string toString() { result = this.getName() }
|
||||||
|
|
||||||
deprecated override predicate hasQualifiedName(string qualifier, string name) {
|
|
||||||
QualifiedName<QualifiedNameInput>::hasQualifiedName(this, qualifier, name)
|
|
||||||
}
|
|
||||||
|
|
||||||
override predicate hasFullyQualifiedName(string qualifier, string name) {
|
override predicate hasFullyQualifiedName(string qualifier, string name) {
|
||||||
QualifiedName<FullyQualifiedNameInput>::hasQualifiedName(this, qualifier, name)
|
QualifiedName<FullyQualifiedNameInput>::hasQualifiedName(this, qualifier, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* DEPRECATED: Use `getFullyQualifiedNameWithTypes` instead.
|
|
||||||
*
|
|
||||||
* Gets the fully qualified name of this declaration, including types, for example
|
|
||||||
* the fully qualified name with types of `M` on line 3 is `N.C.M(int, string)` in
|
|
||||||
*
|
|
||||||
* ```csharp
|
|
||||||
* namespace N {
|
|
||||||
* class C {
|
|
||||||
* void M(int i, string s) { }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
deprecated string getQualifiedNameWithTypes() {
|
|
||||||
exists(string qual |
|
|
||||||
qual = this.getDeclaringType().getQualifiedName() and
|
|
||||||
if this instanceof NestedType
|
|
||||||
then result = qual + "+" + this.toStringWithTypes()
|
|
||||||
else result = qual + "." + this.toStringWithTypes()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the fully qualified name of this declaration, including types, for example
|
* Gets the fully qualified name of this declaration, including types, for example
|
||||||
* the fully qualified name with types of `M` on line 3 is `N.C.M(int, string)` in
|
* the fully qualified name with types of `M` on line 3 is `N.C.M(int, string)` in
|
||||||
@@ -263,17 +236,6 @@ class Member extends Modifiable, @member {
|
|||||||
/** Gets an access to this member. */
|
/** Gets an access to this member. */
|
||||||
MemberAccess getAnAccess() { result.getTarget() = this }
|
MemberAccess getAnAccess() { result.getTarget() = this }
|
||||||
|
|
||||||
/**
|
|
||||||
* DEPRECATED: Use `hasFullyQualifiedName` instead.
|
|
||||||
*
|
|
||||||
* Holds if this member has name `name` and is defined in type `type`
|
|
||||||
* with namespace `namespace`.
|
|
||||||
*/
|
|
||||||
cached
|
|
||||||
deprecated final predicate hasQualifiedName(string namespace, string type, string name) {
|
|
||||||
QualifiedName<QualifiedNameInput>::hasQualifiedName(this, namespace, type, name)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds if this member has name `name` and is defined in type `type`
|
* Holds if this member has name `name` and is defined in type `type`
|
||||||
* with namespace `namespace`.
|
* with namespace `namespace`.
|
||||||
|
|||||||
@@ -38,16 +38,6 @@ class Namespace extends TypeContainer, Declaration, @namespace {
|
|||||||
parent_namespace(result, this)
|
parent_namespace(result, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds if this namespace has the qualified name `qualifier`.`name`.
|
|
||||||
*
|
|
||||||
* For example if the qualified name is `System.Collections.Generic`, then
|
|
||||||
* `qualifier`=`System.Collections` and `name`=`Generic`.
|
|
||||||
*/
|
|
||||||
deprecated override predicate hasQualifiedName(string qualifier, string name) {
|
|
||||||
namespaceHasQualifiedName(this, qualifier, name)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds if this namespace has the qualified name `qualifier`.`name`.
|
* Holds if this namespace has the qualified name `qualifier`.`name`.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user