LLM-Based Repair of Static Nullability Errors
Nima Karimipour, Pascal Joos, Michael Pradel, Martin Kellogg, Manu Sridharan
Key points
From the paper's conclusion- We present NullRepair, a system that integrates LLMs into a structured workflow for resolving the errors from a nullability checker.
Abstract
Modern Java projects increasingly adopt static analysis tools that prevent null-pointer exceptions by treating nullness as a type property. However, integrating such tools into large, existing codebases remains a significant challenge. While annotation inference can eliminate many errors automatically, a subset of residual errors—typically a mix of real bugs and false positives—often persists and can only be resolved via code changes. Manually addressing these errors is tedious and error-prone. Large language models (LLMs) offer a promising path toward automating these repairs, but naively prompted LLMs often generate incorrect, contextually inappropriate edits. We present NullRepair, a system that integrates LLMs into a structured workflow for resolving the errors from a nullability checker. NullRepair’s decision process follows a flowchart derived from manual analysis of 200 real-world errors. It leverages static analysis to identify safe and unsafe usage regions of symbols, using error-free usage examples to contextualize model prompts. Patches are generated through an iterative interaction with the LLM that incorporates project-wide context and decision logic. Our evaluation on 12 real-world Java projects shows that NullRepair resolves 63% of the 1,119 nullability errors that remain after applying a state-of-the-art annotation inference technique. Unlike two baselines (single-shot prompt and mini-SWE-agent), NullRepair also largely preserves program semantics, with all unit tests passing in 10/12 projects after applying every edit proposed by NullRepair, and 98% or more tests passing in the remaining two projects.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- InspectCoder: Dynamic Analysis-Driven Self Repair through Interactive LLM-Debugger CollaborationProceedings of the ACM on Programming Languages · 2026
- CausalRepair: Bridging the Causality Gap in Large Language Model-Based Automated Program Repair via Dual-SlicingProceedings of the ACM on Software Engineering · 2026
- A Survey of LLM-based Software Repair: Taxonomies, Design Paradigms, and ApplicationsACM Transactions on Software Engineering and Methodology · 2026
- Repairing Code Defects Through Multiple LLM Collaboration and Failure Information CapturingSoftware · 2026
- HELO-APR: Enhancing Low-Resource Program Repair through Cross-Lingual Knowledge TransferProceedings of the ACM on software engineering. · 2026
- SWE-PDB: Teaching LLMs to Leverage Debugging Tools via Agentic TrainingProceedings of the ACM on Software Engineering · 2026