Skip to content

Close Scanner in majorVersion#7131

Closed
tejasae-afk wants to merge 2 commits intoopenrewrite:mainfrom
tejasae-afk:fix/close-scanner-in-majorversion
Closed

Close Scanner in majorVersion#7131
tejasae-afk wants to merge 2 commits intoopenrewrite:mainfrom
tejasae-afk:fix/close-scanner-in-majorversion

Conversation

@tejasae-afk
Copy link
Copy Markdown

Came across this in rewrite-core/src/main/java/org/openrewrite/semver/Semver.java while following the call chain — The resource opened there can leak if majorVersion exits on an error path. this patch moves the allocation into try-with-resources so cleanup happens on every exit path. Feel free to close if not relevant.

Happy to revise the approach or close this if it doesn’t fit — you know the codebase far better than I do.

Copy link
Copy Markdown
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.. Thanks for the immediate fix!

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Mar 25, 2026
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Mar 25, 2026
@timtebeek
Copy link
Copy Markdown
Member

What happened here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants