Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Java: index Lombok-generated members, so calls to them resolve by type

Abierto
#2,662 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
devtools

Línea de trabajo

Start by reading the Java extraction and type-aware resolver paths, then inspect the existing tests for generated definitions and name-index registration. The issue describes Lombok annotation and builder cases, but does not name files or tests. Done means Lombok-generated members resolve by type, are excluded from the by-name index, and the generated definition and registration behavior is covered by tests.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement parsing/quality
What problem does this solve?

Lombok writes getters, setters, builders and withers at compile time, so the source has no declaration for invoice.getNumber() or Invoice.builder().number("1").build(). The graph has no node for them, the type-aware resolver cannot find them, and the call binds by name to any project method that happens to share it.

// src/com/example/model/Invoice.java
@Data @Builder
public class Invoice { private String number; private boolean paid; }

// src/com/example/model/Report.java: an unrelated class
public class Report {
    public String getNumber() { return "r"; }
    public static Report builder() { return new Report(); }
}

// src/com/example/app/Caller.java
public String number(Invoice invoice) { return invoice.getNumber(); }
public Invoice make() { return Invoice.builder().number("1").paid(true).build(); }

On main (v0.12.0): number → Report.getNumber (unique_name); make → the fields Invoice.number and Invoice.paid (suffix_match, unique_name); builder() and build() get no edge. On a real Spring service with Lombok, about 8,300 generated members are missing, and Dto.builder() calls bind to whichever project class has the first builder by name.

Proposed solution

In extraction, for a class or field with a Lombok annotation, add the members Lombok would generate as Method (and builder Class) definitions, marked generated and tagged "lombok" in their properties:

  • only annotations that the file's imports make Lombok's (import lombok.Data;, import lombok.*;, or @lombok.Data); Spring's @Value generates nothing;
  • a member the source declares by name is not generated, as Lombok itself skips it;
  • @Getter, @Setter, @Data, @Value (fields final unless @NonFinal), @With, AccessLevel.NONE; then @Builder/@SuperBuilder (also on records, @Builder.Default, builder options) and @Accessors(fluent, chain, prefix);
  • registered by QN only: generated members never enter the by-name index, so the name guess can never pick one; only the type-aware resolver reaches them. On the measured service, registering them by name as well let the name guess land 14,061 extra suffix_match edges on them.

Cost on that service, measured for this together with two smaller resolver fixes: index time about +0.5 s (+10 %), DB +52 MB (+21 %), mostly the generated nodes and their edges.

I have this implemented in two parts (accessors first, then builders and @Accessors), each with tests, and would like a maintainer view before opening the PRs: is a generated member in the definition list acceptable, and is QN-only registration the right way to keep it out of the name guess?

Lenguaje dominante
C
Estrellas
45.8k
Forks
3.8k
Merge medio
3 d 6 h
PR fusionados (30 d)
201

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DeusData/codebase-memory-mcp

Todos los issues de DeusData/codebase-memory-mcp

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.