Skip to content

close BufferedReader in getInput#241

Open
tejasae-afk wants to merge 1 commit into
SeaOfNodes:mainfrom
tejasae-afk:fix/close-bufferedreader-in-getinp
Open

close BufferedReader in getInput#241
tejasae-afk wants to merge 1 commit into
SeaOfNodes:mainfrom
tejasae-afk:fix/close-bufferedreader-in-getinp

Conversation

@tejasae-afk
Copy link
Copy Markdown

The code around line 156 in chapter21/src/test/java/com/seaofnodes/simple/Simple.java looked like it might have an issue. The resource opened there can leak if getInput exits on an error path. this patch moves the allocation into try-with-resources so cleanup happens on every exit path.

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

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.

1 participant