Java: Fix reflection predicate for getMethod having non-public method result

This commit is contained in:
Marcono1234
2022-04-04 15:10:49 +02:00
parent 3119885a9b
commit 6dd14a6cb3

View File

@@ -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())