mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #12954 from aschackmull/java/implicitlypublic
Java: Add SrcCallable.isImplicitlyPublic convenience predicate.
This commit is contained in:
@@ -379,6 +379,19 @@ class SrcCallable extends Callable {
|
||||
this.isProtected() and not tsub.isFinal()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this callable is implicitly public in the sense that it can be the
|
||||
* target of virtual dispatch by a call from outside the codebase.
|
||||
*/
|
||||
predicate isImplicitlyPublic() {
|
||||
this.isEffectivelyPublic()
|
||||
or
|
||||
exists(SrcMethod m |
|
||||
m.(SrcCallable).isEffectivelyPublic() and
|
||||
m.getAPossibleImplementationOfSrcMethod() = this
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** Gets the erasure of `t1` if it is a raw type, or `t1` itself otherwise. */
|
||||
|
||||
Reference in New Issue
Block a user