mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Java: Member.getQualifiedName() tweaked
It now includes the qualified name of the declaring type.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* The `Member.getQualifiedName()` predicate result now includes the qualified name of the declaring type.
|
||||
@@ -20,8 +20,12 @@ class Member extends Element, Annotatable, Modifiable, @member {
|
||||
/** Gets the type in which this member is declared. */
|
||||
RefType getDeclaringType() { declaresMember(result, this) }
|
||||
|
||||
/** Gets the qualified name of this member. */
|
||||
string getQualifiedName() { result = this.getDeclaringType().getName() + "." + this.getName() }
|
||||
/**
|
||||
* Gets the qualified name of this member.
|
||||
* This is useful for debugging, but for normal use `hasQualifiedName`
|
||||
* is recommended, as it is more efficient.
|
||||
*/
|
||||
string getQualifiedName() { result = this.getDeclaringType().getQualifiedName() + "." + this.getName() }
|
||||
|
||||
/**
|
||||
* Holds if this member has the specified name and is declared in the
|
||||
|
||||
@@ -93,8 +93,7 @@ class ExternalApiDataNode extends DataFlow::Node {
|
||||
|
||||
/** Gets the description of the method being called. */
|
||||
string getMethodDescription() {
|
||||
result =
|
||||
this.getMethod().getDeclaringType().getPackage() + "." + this.getMethod().getQualifiedName()
|
||||
result = this.getMethod().getQualifiedName()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user