Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#2,662 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
C
Stelle
45.8k
Fork
3.8k
Merge medio
3g 14h
PR unite (30g)
210

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DeusData/codebase-memory-mcp

Tutte le issue di DeusData/codebase-memory-mcp

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.