You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Java: when two overloads take the call's argument count, the call links to the first overload of any arity #3040
A Java call to an overloaded method normally links to the overload whose parameter count fits. But when two or more overloads share the call's argument count, the call falls back to the first overload declared, even one with a different number of parameters.
line 8 (or 8 and 9, if parameter types aren't compared)
The argument count alone rules out line 7. The fallback should at least stay among the overloads that take the call's argument count.
Where it shows up
jsoup's Jsoup.parse(File, String, String, Parser) calls DataUtil.load(file, charsetName, baseUri, parser). DataUtil has six load overloads, three parameters and four parameters each for File, Path and InputStream. The call links to load(File, String, String) at line 68, not to load(File, String, String, Parser) at line 86. Calls of this shape came up repeatedly when I diffed jsoup's call edges against scip-java (the Java compiler's references).
Environment: Linux (WSL2), Node 22.23.2. Reproduced on main at 60b0d7a both with CODEGRAPH_KERNEL=0 and with the native kernel.
Related: argument-count overload selection landed for C++ (#2541), Swift (#2238) and Solidity (#2241). #2820 covers which overrides an overload links to, not which overload a call picks.
Edited 2026-10-29: replaced "accounts for most of the disagreements" with "came up repeatedly". I checked samples of the disagreements, not all of them. Nothing else changed.
Activity