mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Java: Fix reflection predicate for getMethod having non-public method result
This commit is contained in:
@@ -355,9 +355,11 @@ class ReflectiveMethodAccess extends ClassMethodAccess {
|
||||
then
|
||||
// The method must be declared on the type itself.
|
||||
result.getDeclaringType() = this.getInferredClassType()
|
||||
else
|
||||
// The method may be declared on an inferred type or a super-type.
|
||||
else (
|
||||
// The method must be public, and declared or inherited by the inferred class type.
|
||||
result.isPublic() and
|
||||
this.getInferredClassType().inherits(result)
|
||||
)
|
||||
) and
|
||||
// Only consider instances where the method name is provided as a `StringLiteral`.
|
||||
result.hasName(this.getArgument(0).(StringLiteral).getValue())
|
||||
|
||||
Reference in New Issue
Block a user