Skip to content

fix(extract): resolve Java member calls by receiver type#1697

Closed
oleksii-tumanov wants to merge 3 commits into
Graphify-Labs:v8from
oleksii-tumanov:fix/java-receiver-resolution
Closed

fix(extract): resolve Java member calls by receiver type#1697
oleksii-tumanov wants to merge 3 commits into
Graphify-Labs:v8from
oleksii-tumanov:fix/java-receiver-resolution

Conversation

@oleksii-tumanov

@oleksii-tumanov oleksii-tumanov commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve the receiver and static receiver type for Java member calls
  • resolve simple explicit type receivers, current-class fields, parameters, and explicitly typed locals with method-scoped bindings
  • skip ambiguous, inherited, and chained receivers; defer fully qualified and nested type receivers because they require package- and nesting-aware type identity

Fixes #1696

Result

Label-normalized call edges:

run -> PaymentGateway.ping [EXTRACTED]
run -> PaymentGateway.charge [INFERRED]

The three charge() calls deduplicate to one edge, and no edge targets the same-named AuditLog methods.

Testing

  • uv run --frozen pytest tests/test_languages.py tests/test_java_type_resolution.py tests/test_java_member_calls.py -q -k java (38 passed, 310 deselected)
  • uv run --frozen ruff check graphify/extract.py graphify/extractors/engine.py tests/test_java_member_calls.py (passed)

@oleksii-tumanov oleksii-tumanov force-pushed the fix/java-receiver-resolution branch from b1d04a6 to 74b0cd1 Compare July 9, 2026 16:50
@oleksii-tumanov

oleksii-tumanov commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@safishamsi I updated the PR following your change/suggestions in #1737. Please review.

@safishamsi

Copy link
Copy Markdown
Collaborator

Merged on v8 in dae602c, authored to you. Clean, well-scoped fix that follows the receiver-typed resolution pattern the C#/Swift/Ruby resolvers already use.

Verified before landing:

  • Applies cleanly to the post-refactor: decompose extract.py and __main__.py into focused modules #1737 layout (you'd already targeted extractors/engine.py, so no re-mapping needed — GitHub just hadn't recomputed mergeability).
  • Reproduced Java member calls lose receiver type information #1696: with PaymentGateway gw and a same-named AuditLog, gw.ping()/gw.charge() now bind to PaymentGateway, the three charge() calls dedup to one edge, and zero edges target the AuditLog methods.
  • The god-node guard is right: missing/ambiguous/inherited/chained receivers are skipped rather than guessed, so no bare-name fallback re-introduces phantoms. Deferring FQ/nested-type receivers is the correct call — they need package/nesting-aware identity.
  • Your 13 tests pass; full suite 3135 passed / 3 skipped.

Thanks for matching the existing resolver conventions so closely.

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 member calls lose receiver type information

2 participants