Close streams in finally block. #115

Merged
merged 1 commit into from Aug 21, 2013

Conversation

Projects
None yet
2 participants
@fzs
Collaborator

fzs 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 streams in finally block.
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

Merge pull request #115 from fzs/fu-close-finally
Close streams in finally block.

@gitblit gitblit merged commit 2806d98 into gitblit:master Aug 21, 2013

@fzs fzs deleted the fzs:fu-close-finally branch Aug 26, 2013

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