Skip to content

Call resolver (java): bodyless interface/abstract methods are never call targets (#3836) - #4133

Merged
squid-protocol merged 5 commits into
mainfrom
fix/3836-java-signature
Oct 2, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
fix/3836-java-signature

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes #3836

Root cause: def_shape = signature (#3757) was TS/JS-only, so Java's ;-terminated interface and abstract methods were indexed as targets. Simply dropping them (the TS approach) exposed a second problem: a bare readField() in abstract Adapter walked on to an unrelated Adapter class in another module (proto/), and iface.m() became a confident link to whichever implementation happened to be visible.

Fix: the detector marks Java bodyless methods signature (but not native ones). The resolver still never targets them, but keeps them on the bucket. As a result:

  • a lineage walk that reaches a class that only declares the method stops there, as an ambiguous receiver (a dispatch);
  • a declaring interface counts as one more candidate class for an untyped receiver.

gson vs scip-java: confident unmapped is 97 -> 65 (all 32 bodyless targets gone; triage unmapped_dst is 42 -> 10, and the 10 left are records, a different pattern). Confident unconfirmed is +1. Precision 92.7%, recall 41.0% and resolution recall 43.6% are unchanged. TypeScript (zod) and Python (pyan3 2.8.1) are byte-identical. Java baseline regenerated (confident_unmapped).

Left out on purpose: C# and Kotlin have the same shape, but no compiler reference measures them yet. The guard test pins C# as unchanged.

Draft / still to do: tests/tools/pr_gates.py was not run (the budget ran out). Unit tests pass: test_call_resolver (63) and the new detector test.

🤖 Generated with Claude Code

…res, never targets (#3836)

Detector: a java method ending in ';' (interface / abstract) gets def_shape
'signature' (native excluded). Resolver: signatures stay non-targets (#3757) but
are kept per bucket so (a) a lineage walk that reaches a class only DECLARING the
name stops as an ambiguous 'receiver' dispatch instead of jumping to a namesake
class in another file, and (b) a declaring interface counts as a candidate class
for an untyped receiver.

gson vs scip-java: confident unmapped 97 -> 65 (the 32 bodyless targets), confident
unconfirmed +1, every gated metric unchanged. TypeScript and Python unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol and others added 3 commits October 2, 2026 12:06
# Conflicts:
#	tests/call_graph_resolution_java_baseline.json
…all targets)

Drift is the scan-DB snapshot (fan in/out, import edges, PageRank) on the Java
samples whose calls used to resolve to interface/abstract signatures (springboot,
gradle, spock), plus the PageRank/network-macro ripple across the whole graph and
the springboot repository fingerprint/centroid distance that the import edges feed.
Blessed per golden-bless-env-contract: galaxy_venv (full) and galaxy_zero_venv
(PyYAML only), with a galaxyscope PATH shim so the scan ran this worktree's engine.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-protocol
squid-protocol marked this pull request as ready for review October 2, 2026 17:16
# Conflicts:
#	tests/call_graph_resolution_java_baseline.json
@squid-protocol
squid-protocol merged commit a4b2d33 into main Oct 2, 2026
36 checks passed
@squid-protocol
squid-protocol deleted the fix/3836-java-signature branch October 2, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java: confident links to bodyless interface / abstract methods (#3757's pattern outside TS/JS)

1 participant