Fixrleak: Fixing Java Resource Leaks with GenAI
1–10 of 24 posts
Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#2Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#3Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#4C# has Roslyn analyzers for this. Doesn't java have something similar ? Is AI appropriate technology for static analysis ?
LLMs seems overkill for this. But of course letting it do general code reviews is not a bad idea. And static code analyzers aren't perfect. Doing this at scale might be a bit tricky though; you'd have to go file by file. I assume Uber might have many millions of lines of code to screen. And maybe their developers aren't that concerned with addressing warnings.
But going file by file might be simple enough. And you can probably screen for important stuff with some decent system prompt and instruct it to check for potential resource leaks and similar issues and produce detailed bug reports with some priority if it finds them and a diff that addresses the issue. Could be a nice use case for agentic AIs to screen code like this.
Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#5C# has Roslyn analyzers for this. Doesn't java have something similar ? Is AI appropriate technology for static analysis ?
Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#6C# has Roslyn analyzers for this. Doesn't java have something similar ? Is AI appropriate technology for static analysis ?
There were static code analyzers like findbugs able to do stuff like this 20 years ago. These days, your IDE should tell you off as well. And hopefully teams configure their builds to catch stuff like this using any of the available plugins for this. LLMs seems overkill for this. But of course letting it do general code reviews is not a bad idea. And static code analyzers aren't perfect. Doing this at scale might be…
Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#7Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#8Stringly-typed, catch-log-ignore, generates warnings in IDE anyway...
Fixed 90 of 125 errors that were found by a different technology... probably.could have been fixed by one developer in 1-2 days anyway - how long did this take?
Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#9This could be interesting, but all the example code is so poor, and the extent of the fix so limited that it feels like this is 'AI' for the sake of it. Stringly-typed, catch-log-ignore, generates warnings in IDE anyway... Fixed 90 of 125 errors that were found by a different technology... probably.could have been fixed by one developer in 1-2 days anyway - how long did this take?
Besides, gotta start somewhere. It's probably a PoC, for a platform that will eventually handle all sorts of things.
Re: Fixrleak: Fixing Java Resource Leaks with GenAI
#10won't FileReader leak if the BufferedReader constructor throws?