[
https://issues.apache.org/jira/browse/FLINK-2913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15008524#comment-15008524
]
ASF GitHub Bot commented on FLINK-2913:
---------------------------------------
Github user StephanEwen commented on the pull request:
https://github.com/apache/flink/pull/1353#issuecomment-157345512
How about using a try-with-resources statement here?
I would like to use this whenever we touch code that needs to ensure
closing a resource...
> Close of ObjectOutputStream should be enclosed in finally block in
> FsStateBackend
> ---------------------------------------------------------------------------------
>
> Key: FLINK-2913
> URL: https://issues.apache.org/jira/browse/FLINK-2913
> Project: Flink
> Issue Type: Bug
> Reporter: Ted Yu
> Priority: Minor
>
> {code}
> ObjectOutputStream os = new ObjectOutputStream(outStream);
> os.writeObject(state);
> os.close();
> {code}
> If IOException is thrown out of writeObject(), the close() call would be
> skipped.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)