mirror of
https://github.com/github/codeql.git
synced 2026-02-28 12:53:49 +01:00
Merge pull request #5270 from Marcono1234/marcono1234/class-isPackageProtected
Java: Add Class and Interface.isPackageProtected()
This commit is contained in:
@@ -599,6 +599,13 @@ class Class extends RefType, @class {
|
||||
/** Holds if this class is a local class. */
|
||||
predicate isLocal() { isLocalClass(this, _) }
|
||||
|
||||
/** Holds if this class is package protected, that is, neither public nor private nor protected. */
|
||||
predicate isPackageProtected() {
|
||||
not isPrivate() and
|
||||
not isProtected() and
|
||||
not isPublic()
|
||||
}
|
||||
|
||||
override RefType getSourceDeclaration() { classes(this, _, _, result) }
|
||||
|
||||
/**
|
||||
@@ -816,6 +823,13 @@ class Interface extends RefType, @interface {
|
||||
any()
|
||||
}
|
||||
|
||||
/** Holds if this interface is package protected, that is, neither public nor private nor protected. */
|
||||
predicate isPackageProtected() {
|
||||
not isPrivate() and
|
||||
not isProtected() and
|
||||
not isPublic()
|
||||
}
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Interface" }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user