github / github/codeql

Java: `ReflectiveMethodAccess::inferAccessedMethod()` ignores parameters

Open
#13,490 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

The Java predicate `ReflectiveMethodAccess::inferAccessedMethod()` only checks the name of the method but ignores the parameters:
https://github.com/github/codeql/blob/04a7ff7f762cd11d9cba0ab864cc6bb909a830c8/java/ql/lib/semmle/code/java/Reflection.qll#L363-L366

This leads to incorrect results when a class declares multiple methods with the same name but different signature.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.