JADE
JADE - Java Static Analysis Repair is a VS Code extension for analyzing Java code and generating traceable repair suggestions with local LLMs.
JADE combines Java static-analysis heuristics, local models through Ollama, optional RAG context, AI execution reports, safe fix validation, model comparison, and structured user feedback.
Features
- Analyze Java files directly from VS Code.
- Generate diagnostics for code smells, bugs, security issues, and duplication.
- Ask a local LLM to generate structured quick fixes.
- Validate generated patches before applying them to the editor.
- Review suggestions in a report panel and save structured feedback.
- Compare supported local models on fixed benchmark samples or on the open Java file.
- Export reports for auditability and research.
Requirements
- VS Code compatible with
^1.118.0.
- Ollama running locally.
- At least one supported model installed:
ollama pull deepseek-coder:6.7b
or:
ollama pull qwen2.5-coder:7b
Optional:
- Docker, if you want to run
JADE: Setup for Qdrant and SonarCloud-backed RAG.
Quick Start
- Start Ollama.
- Open a Java workspace in VS Code.
- Open a
.java file.
- Run
JADE: Select Ollama model and choose the active model.
- Run
JADE: Analyze File.
- Review diagnostics in the editor and in the report panel.
- Use
JADE: Generate Fix with AI on a selected JADE diagnostic when you want a repair suggestion.
- Save feedback in the report panel when a suggestion is useful, wrong, partial, or unclear.
Demo Sample
For a short demo, use a sample like this:
public class PresentationWorkingSample {
public void runHeavyProcess(int seed) {
System.out.println("inicio do processamento pesado");
try {
validateSeed(seed);
} catch (IllegalArgumentException ex) {
}
int result = calculateResult(seed);
System.out.println("resultado=" + result);
}
private int calculateResult(int seed) {
int result = seed;
for (int step = 1; step <= 41; step++) {
result += step;
}
return result;
}
private void validateSeed(int seed) {
if (seed < 0) {
throw new IllegalArgumentException("seed nao pode ser negativo");
}
}
}
The expected issue is the empty catch block. It catches IllegalArgumentException but does not handle it, so validation failures can be silently swallowed and the method may continue as if nothing happened.
Commands
| Command |
Description |
JADE: Analyze File |
Run AI-assisted static analysis on the current Java file. |
JADE: Generate Fix with AI |
Generate and apply a validated repair for a JADE diagnostic. |
JADE: Select Ollama model |
Choose the active local Ollama model. |
JADE: Setup |
Configure optional Docker, Qdrant, SonarCloud, and RAG setup. |
JADE: Reset Setup |
Reset RAG setup state and fall back to embedded heuristics. |
JADE: Run Model Comparison |
Run the reproducible benchmark against supported models. |
JADE: Compare Models on Open Java File |
Compare supported models on the currently open Java file. |
JADE: Export Model Comparison Samples |
Export official benchmark samples to the workspace. |
JADE: Open Latest AI Report |
Open the latest AI execution report. |
JADE: Open Latest Model Comparison Report |
Open the latest model comparison report. |
JADE: Export Feedback |
Open the external feedback form. |
Extension Settings
| Setting |
Description |
jade.ollama.baseUrl |
Ollama API base URL. |
jade.ollama.model |
Active Ollama model. |
jade.ollama.requestTimeoutMs |
Request timeout in milliseconds. |
jade.ai.batchMaxLines |
Maximum Java lines per AI batch. |
jade.ai.batchOverlapLines |
Overlap between consecutive batches. |
jade.rag.qdrant.url |
Qdrant URL used after setup. |
jade.rag.embedding.model |
Ollama embedding model used for RAG retrieval. |
Model Comparison Protocol
JADE includes a reproducible benchmark battery for comparing Deepseek and Qwen through Ollama.
- Run
JADE: Run Model Comparison to execute the fixed benchmark.
- Results are written to
model-comparison-results/ in the open workspace.
- Run
JADE: Compare Models on Open Java File to compare Deepseek and Qwen against the currently open Java file.
- Open-file comparison has no fixed ground truth, so it records model outputs and response metrics without treating suggestions as academically validated false positives.
- Run
JADE: Export Model Comparison Samples to copy the official Java samples, expected findings, and protocol material into the open workspace for inspection.
The benchmark always reads the official samples packaged with the extension. Exporting samples is for auditability and documentation; it does not mutate the packaged benchmark battery.
Development
Clone the project and enter the extension root:
cd /Users/ruanneres/www/person/project/plugin-ai/plugin/UDIA
Install dependencies:
pnpm install
Run the full validation suite:
pnpm test
Run individual checks:
pnpm run check-types
pnpm run lint
pnpm run compile
Run the extension in development mode:
- Open the project in VS Code.
- Press
F5.
- In the Extension Development Host window, open a Java file.
- Run
JADE: Analyze File from the Command Palette.
Build and Package
Create the production bundle:
pnpm run package
Create an installable .vsix package:
pnpm run vsix
Install the generated .vsix locally:
code --install-extension jade-static-analysis-repair-0.0.1.vsix
Adjust the file name if the version in package.json has changed.
License
MIT