[KongchangAI]
Person

Njabulo Ncube

A software developer who shares technical practices on the dev.to platform, covering experience in building a local LLM-assisted Java code repair tool.

Timeline (last 90 days)

Oct 15

Developer Njabulo Ncube shared on dev.to his practical experience of building a Java repair tool with a local LLM, and put forward three lessons.

Unverified50%
Oct 15

Ncube's strategy is to prioritize including direct dependencies, summarize indirect dependencies, and strike a balance between 'giving enough information' and 'not exceeding the window'.

Unverified50%
Oct 15

Ncube found that directly describing 'please fix this Java code' in natural language was not effective, and the local LLM was prone to two types of problems: the generated code was syntactically correct but semantically off, or it fixed the surface problem but introduced new compilation errors.

Unverified50%
Oct 15

Ncube adopted a more structured prompt format (explicitly specifying the Java version, dependency libraries, expected fix type, and requiring a specific output format), which significantly improved fix accuracy.

Unverified50%
Oct 15

After the LLM generates a fix, Ncube's tool automatically invokes the Java compiler to verify it, and if compilation fails, feeds the error information back to the LLM for a second fix, forming a 'generate-verify-regenerate' iterative loop.

Unverified50%

All Facts (5)

Source Articles