◐ Shell
reader mode source ↗
Skip to content

Updated readInt method so streams are closed on failure or success#1476

Open
srnkan wants to merge 2 commits into
processing:mainfrom
srnkan:ClosingStreamsIssue
Open

Updated readInt method so streams are closed on failure or success#1476
srnkan wants to merge 2 commits into
processing:mainfrom
srnkan:ClosingStreamsIssue

Conversation

@srnkan

@srnkan srnkan commented Mar 11, 2026

Copy link
Copy Markdown

✅ Title: clear and descriptive

✅ Resolves: Resolves #1416

✅ Changes: I adapted the preexisting readInt method to include a try-with-resources, which closes all "closeables" regardless if the code errors or runs smoothly. This stops memory leakage by always closing necessary streams.

✅ Tests: Tests pass the "./gradlew test" and I did not add any additional tests

✅ Checklist: Tests pass the "./gradlew test" tests and branch is up-to-date

@catilac catilac closed this Mar 11, 2026
@catilac catilac reopened this Mar 11, 2026
@srnkan

srnkan commented Mar 11, 2026

Copy link
Copy Markdown
Author

I'd like @Ebaron96 to be assigned as a reviewer if possible

@catilac

catilac commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

@srnkan sorry for the confusion in closing the issue without comment. i'll leave a review soon. i can't add ebaron96 as a reviewer until they have contributed code. but they are welcome to review.

@catilac catilac self-requested a review March 11, 2026 17:55

@catilac catilac left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hide comment

This is a great start! I noticed there aren't any tests in the UpdateCheckTest class.
It could use some!

@srnkan srnkan force-pushed the ClosingStreamsIssue branch from 47a8802 to b9b794e Compare March 23, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclosed file streams in UpdateCheck

3 participants