Skip to content

Commit 7e83a60

Browse files
authored
Merge pull request github#4954 from aschackmull/java/member-hasqualifiedname
Java: Add Member.hasQualifiedName.
2 parents 161e756 + f3b8fe2 commit 7e83a60

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

java/ql/src/semmle/code/java/Member.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ class Member extends Element, Annotatable, Modifiable, @member {
2323
/** Gets the qualified name of this member. */
2424
string getQualifiedName() { result = getDeclaringType().getName() + "." + getName() }
2525

26+
/**
27+
* Holds if this member has the specified name and is declared in the
28+
* specified package and type.
29+
*/
30+
predicate hasQualifiedName(string package, string type, string name) {
31+
this.getDeclaringType().hasQualifiedName(package, type) and this.hasName(name)
32+
}
33+
2634
/** Holds if this member is package protected, that is, neither public nor private nor protected. */
2735
predicate isPackageProtected() {
2836
not isPrivate() and

0 commit comments

Comments
 (0)