Java: same-name overloads collapse to one node in 0.12.1 (get_file_outline/search_graph omit a declaration)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 54/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C
- Estrellas
- 45.8k
- Forks
- 3.8k
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 108
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DeusData/codebase-memory-mcp
-
bug ux/behavior
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
DeusData/codebase-memory-mcp#3191 ·
Los mantenedores suelen responder en 1 día
-
documentation enhancement parsing/quality ux/behavior
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
DeusData/codebase-memory-mcp#3131 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug editor/integration parsing/quality ux/behavior
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DeusData/codebase-memory-mcp#3062 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Generated client files (AGENTS.md block, SKILL.md) teach a call syntax no harness can executeAbiertobug documentation editor/integration parsing/quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DeusData/codebase-memory-mcp#3050 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
editor/integration parsing/quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DeusData/codebase-memory-mcp#2286 ·
Los mantenedores suelen responder en 1 día
Todos los issues de DeusData/codebase-memory-mcp
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
Los mantenedores suelen responder en 1 día
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameAbiertogame: 010065A014024000 ios
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
seedds/nxnative#3714 · 1 comentario ·
Los mantenedores suelen responder en 2 días