Skip to content

Java member calls lose receiver type information #1696

Description

@oleksii-tumanov

Context

On v8, Java method_invocation entries drop receiver and type information. With same-named methods in multiple classes, resolution is ambiguous and no call edges are emitted.

Reproducer

Services.java

class PaymentGateway { static void ping() {} void charge() {} }
class AuditLog { static void ping() {} void charge() {} }

Checkout.java

class Checkout {
    PaymentGateway gateway;

    void run(PaymentGateway parameter) {
        PaymentGateway.ping();
        gateway.charge();
        this.gateway.charge();
        parameter.charge();
    }
}

Current behavior

Representative cache shapes (paths, locations, and repeated call sites omitted):

[
  {"callee": "ping", "is_member_call": false, "receiver": null},
  {"callee": "charge", "is_member_call": false, "receiver": null}
]

All four call sites are stored without receiver information.

Expected

Preserve the receiver and static receiver type per call site, then resolve only unambiguous owners:

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

The three charge() calls remain separate in the cache but deduplicate to one graph edge. No edge should target the same-named AuditLog methods.

Scope

Cover explicit type receivers, current-class fields, parameters, and explicitly typed locals. Defer inherited fields, chained receivers, interface/runtime dispatch, and target overload selection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions