Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close streams in finally block. #115

Merged
merged 1 commit into from Aug 21, 2013
Merged

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.

None yet

2 participants