Commit Graph
4 Commits
Author SHA1 Message Date
Martin Vogel ee6e78b714 fix(java): ignore comment extras in record accessor parameters
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-21 23:22:14 +02:00
Martin Vogel 321dcb63f9 Merge main and complete Java record call handling
Preserve the current C/C++ field-binding policy while integrating the Java
record accessor change. Handle varargs record components with array return
types and reject data targets before sequential LSP call emission, matching
the parallel path. Add focused regressions for both cases.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-21 02:12:36 +02:00
MopicMPandClaude Opus 5 f4c897110c fix(java): resolve record accessor calls, and never bind a call to data
A record's accessors are implicit, so `record Point(double x, double y,
double z)` declares no `x()` and extraction emitted no node for one. The call
`p.x()` had nothing to resolve to, fell through to the short-name registry,
and bound to the first `x` in the project — typically an unrelated class's
private field. Measured on two indexed Java trees, that was 278 of 2444 and
2649 of 29509 CALLS edges.

Extraction now emits one Method definition per record component, skipping any
accessor the record declares itself (JLS 8.10.3), so the accessor has a node
and the call resolves to it.

And a Java call may no longer bind to a Variable or a Field. A Java call
expression never names data, so such an edge is a spelling collision, not a
call. The guard follows cbm_go_suppress_bare_field_ref — a pure, label-keyed
predicate — and is called from both pass_calls.c and pass_parallel.c so the
sequential and parallel resolvers stay identical. Java-gated: Kotlin
properties hold function values and C has function pointers, so both
legitimately call through data.

Signed-off-by: MopicMP <obshiq123@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 22:44:31 +02:00
Martin Vogel 87a0e3f74f fix: preserve semantic graph relationships
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-07-18 15:52:50 +02:00