Quality assurance · Production

FixrLeak: Uber's GenAI framework for automated Java resource leak repair

The problem

Resource leaks in Java applications lead to performance degradation and system failures, and while SonarQube identifies them effectively, the fixing process remained manual, time-consuming, and error-prone at Uber's codebase scale.

First attempt

Template-based tools like RLFixer struggled to scale in Uber's massive codebase and required extensive manual setup. GenAI predecessor InferFix achieved only 70% fix accuracy and relied on proprietary models that couldn't adapt to evolving technologies.

Workflow diagram · grounded in source
1
SonarQube leak report scanning
trigger
“FixrLeak starts by scanning resource leaks reported by SonarQube, gathering key details like file names and line numbers”
2
Code parsing with Tree-sitter
integration
“FixrLeak uses the Tree-sitter library to parse the code and extract the relevant function for analysis”
3
AST-level safety validation
validation
“FixrLeak uses Tree-sitter to perform AST (Abstract Syntax Tree) analysis. This analysis ensures that FixrLeak skips functions where resources are passed as parameters, returned, or stored in fields”
4
GenAI fix generation via ChatGPT-4O
ai_action
“FixrLeak crafts a tailored prompt and sends it to a generative AI model like OpenAI® ChatGPT-4O. The AI responds with a suggested fix, which FixrLeak applies by replacing the original leaky function with the new, leak-free version”
5
Pull request generation
output
“FixrLeak generates a pull request, streamlining the process for developers to review and approve the fix”
6
Automated PR verification
validation
“It verifies that the target binary builds successfully, runs all existing tests to confirm nothing is broken, and can also recheck the code with SonarQube to confirm the resource leak has been resolved”
7
Developer one-click code review
human_review
“The final step is code review from the developers to accept the pull request. Usually, all they need to do is one-click accept”
Reported outcome

FixrLeak successfully automated fixes for 93 out of 102 eligible resource leaks in Uber's Java codebase, significantly reducing manual effort and improving developer productivity and code quality, and continues to run periodically.

Reported metrics
Resource leaks automatically fixed93
Eligible cases processed102
Total resource leaks scanned in test124
Manual effort reductionsignificantly reduces manual effort
Show all 6 reported metrics
resource leaks automatically fixed93
eligible cases processed102
total resource leaks scanned in test124
manual effort reductionsignificantly reduces manual effort
developer productivity improvementimproves developer productivity
InferFix predecessor fix accuracy (baseline comparison)70%
Reported stack
SonarQubeTree-sitterChatGPT-4OFixrLeak
Source
https://www.uber.com/en-NL/blog/fixrleak-fixing-java-resource-leaks-with-genai/
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

FixrLeak successfully automated fixes for 93 out of 102 eligible resource leaks in Uber's Java codebase, significantly reducing manual effort and improving developer productivity and code quality, and continues to run…

What tools did this team use?

SonarQube, Tree-sitter, ChatGPT-4O, FixrLeak.

What results were reported?

Resource leaks automatically fixed: 93; Eligible cases processed: 102; Total resource leaks scanned in test: 124; Manual effort reduction: significantly reduces manual effort (source-reported, not independently verified).

What failed first in this deployment?

Template-based tools like RLFixer struggled to scale in Uber's massive codebase and required extensive manual setup.

How is this quality assurance AI workflow structured?

SonarQube leak report scanning → Code parsing with Tree-sitter → AST-level safety validation → GenAI fix generation via ChatGPT-4O → Pull request generation → Automated PR verification → Developer one-click code review.