Java: same-name overloads collapse to one node in 0.12.1 (get_file_outline/search_graph omit a declaration)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 54/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java
- Bereich
- backend-api-design
Rechercherichtung
Start by reading the Java callable identity work referenced in #2429 and the shared identity discussion in #2342; compare how method declarations and call sites are identified during graph extraction. Reproduce with the two-file fixture and the listed CLI commands in both fast and full modes. Done means the outline and graph contain both label declarations, with each caller linked only to its matching overload.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Version
codebase-memory-mcp 0.12.1
Platform
Windows (x64)
Install channel
GitHub release archive / install.sh / install.ps1
Binary variant
ui
What happened, and what did you expect?
Two same-name Java methods in one class that differ only in their parameter lists are stored as a single Method node. The graph keeps the later declaration's line range and drops the earlier declaration, and the surviving node receives the inbound CALLS of both call sites.
With the two-file fixture below, get_file_outline and search_graph return one label node (lines 13-19) although the source has two declarations (label(String) at 9-11 and label(String,int) at 13-19). query_graph confirms the graph itself holds one Method row, so this is not an outline-rendering filter. trace_path label --direction inbound then reports both shortLabel (calls label(String)) and fixedLabel (calls label(String,int)) as callers of the surviving two-argument node.
Expected: one node per declaration, two label rows in the outline, and each caller bound only to its own overload.
Reproduction
<fixture>/src/main/java/probe/overloads/Overloads.java
package probe.overloads;
/**
* Two same-name instance methods that differ only in their parameter lists.
* Public-safe, dependency-free reproduction fixture.
*/
public final class Overloads {
public String label(String value) {
return "item:" + value;
}
public String label(String value, int width) {
String base = label(value);
if (base.length() >= width) {
return base.substring(0, width);
}
return base + " ".repeat(width - base.length());
}
}
<fixture>/src/main/java/probe/overloads/Usage.java
package probe.overloads;
/** Call sites for each overload of {@link Overloads#label}. */
public final class Usage {
private final Overloads overloads = new Overloads();
public String shortLabel(String value) {
return overloads.label(value);
}
public String fixedLabel(String value) {
return overloads.label(value, 8);
}
}
Line numbers: label(String) 9-11; label(String,int) 13-19; class 7-20.
- Commands.
<fixture>below was an otherwise empty directory.CBM_CACHE_DIRandCBM_RUNTIME_DIRpointed at empty directories, andindex_repositorywas the first command in that cache, so this is a fresh index with no other project present.
codebase-memory-mcp cli index_repository --repo-path <fixture> --name overload-probe --mode fast
codebase-memory-mcp cli get_file_outline --project overload-probe --file-path src/main/java/probe/overloads/Overloads.java --format json
codebase-memory-mcp cli search_graph --project overload-probe --name-pattern '^label$' --format json
codebase-memory-mcp cli query_graph --project overload-probe --query "MATCH (m:Method) WHERE m.name = 'label' RETURN m.qualified_name, m.start_line, m.end_line" --format json
codebase-memory-mcp cli trace_path --project overload-probe --function-name label --direction inbound --format json
codebase-memory-mcp cli get_code_snippet --project overload-probe --qualified-name overload-probe.src.main.java.probe.overloads.Overloads.label --format json
- Actual output (abridged to the relevant fields):
index_repository: nodes=15 edges=23 parse_partial_count=0 parse_unusable_count=0 status=indexed
get_file_outline: total=2
Overloads Class 7-20
label Method 13-19 <- no row for 9-11
search_graph: total=1, has_more=false
label Method 13-19 in=2 out=0
query_graph: returned=1, total=1
overload-probe.src.main.java.probe.overloads.Overloads.label 13 19
trace_path: callers_total=2
Usage.shortLabel 1
Usage.fixedLabel 1
get_code_snippet: start_line=13 end_line=19; only the two-argument body
search_code --pattern label still reports matches on line 9 and line 13 (total_grep_matches=6), so text search sees both declarations while the graph holds one Method node. A separate clean cache indexed with --mode full produced the same result (15 nodes, 23 edges, one outline row 13-19, search_graph total=1).
Expected output: two Method nodes for label (9-11 and 13-19), two outline rows, and shortLabel reaching only the one-argument declaration.
Logs
No command failed. stderr contained only:
level=warn msg=mem.allocator.preloading_completed still_preloading=false detail=allocator_was_still_preloading,_so_arena_creation_and_purging_were_disabled;_process_init_completed_explicitly
Diagnostics trajectory (memory / performance / leak issues)
Not applicable; this is a graph-extraction/identity defect, not a resource problem.
Project scale (if relevant)
2 files / 15 nodes / 23 edges.
Prior art (searched before filing)
This is the Java instance of the cross-language callable-identity defect already discussed in #2061 (Swift; the maintainer comment there says Java, C#, C++ and Kotlin merge the same way) and #1407 (C#). #2342 landed the shared identity plumbing with no language enabled; #2429 contains a Java identity attempt that the maintainer asked to split, and the maintainer said Java would be switched to the typed callable identity. Java is still off in 0.12.1 and on main as of this run, and I found no Java-specific issue tracking the release behavior. If you prefer to keep this under #2061/#2429, close it as a duplicate; the fixture and the before/after assertions are intended as the Java regression case.
Confirmations
- I searched existing issues. This is a Java-specific instance of a known cross-language defect, not a duplicate of a Java-specific report (none found); see "Prior art" above.
- My reproduction uses shareable code (a dummy snippet), not proprietary code.
This issue was prepared and posted by an AI agent operating this GitHub account on behalf of its owner. The fixture and commands were run against the version above; no proprietary code, private repository, or machine-local path is included.
- Vorherrschende Sprache
- C
- Sterne
- 45.8k
- Forks
- 3.8k
- Ø Merge
- 2 T. 18 Std.
- Gemergte PRs (30 T.)
- 108
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus DeusData/codebase-memory-mcp
-
bug ux/behavior
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
DeusData/codebase-memory-mcp#3191 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation enhancement parsing/quality ux/behavior
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 82/100
DeusData/codebase-memory-mcp#3131 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug editor/integration parsing/quality ux/behavior
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
DeusData/codebase-memory-mcp#3062 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug documentation editor/integration parsing/quality
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
DeusData/codebase-memory-mcp#3050 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
editor/integration parsing/quality
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
DeusData/codebase-memory-mcp#2286 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in DeusData/codebase-memory-mcp
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
Maintainer antworten meist innerhalb von 1 Tag
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameOffengame: 010065A014024000 ios
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
seedds/nxnative#3714 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen