Skip to content

Conversation

flaix
Copy link
Member

@flaix flaix commented Aug 21, 2013

The FileUtils use input and output streams which are closed within the try block instead of a finally block. This patch moves the close into a finally block to make sure that system resources get freed.

Just as a comment, one may want to revisit the class and change the catching of Throwables to catching Exceptions instead, as Errors should usually not be caught by an application.

Close input and output streams in a finally block so that they do not linger around and occupy system resources when an exception occurs.
gitblit added a commit that referenced this pull request Aug 21, 2013
Close streams in finally block.
@gitblit gitblit merged commit 2806d98 into gitblit-org:master Aug 21, 2013
@flaix flaix deleted the fu-close-finally branch August 26, 2013 14:20
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.

2 participants