mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Java: move veryPublic predicate
This commit is contained in:
@@ -340,23 +340,23 @@ class Callable extends StmtParent, Member, @callable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the given type is public and not a nested type.
|
||||
* If the given type is a nested type, holds if its enclosing type
|
||||
* is also public.
|
||||
*/
|
||||
private predicate veryPublic(RefType t) {
|
||||
t.isPublic() and
|
||||
(
|
||||
not t instanceof NestedType or
|
||||
veryPublic(t.(NestedType).getEnclosingType())
|
||||
)
|
||||
}
|
||||
|
||||
/** A callable that is the same as its source declaration. */
|
||||
class SrcCallable extends Callable {
|
||||
SrcCallable() { this.isSourceDeclaration() }
|
||||
|
||||
/**
|
||||
* Holds if the given type is public and not a nested type.
|
||||
* If the given type is a nested type, holds if its enclosing type
|
||||
* is also public.
|
||||
*/
|
||||
private predicate veryPublic(RefType t) {
|
||||
t.isPublic() and
|
||||
(
|
||||
not t instanceof NestedType or
|
||||
veryPublic(t.(NestedType).getEnclosingType())
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this callable is effectively `public`, meaning that it can be
|
||||
* called outside the codebase.
|
||||
|
||||
Reference in New Issue
Block a user