[
https://issues.apache.org/jira/browse/BEAM-1832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15961622#comment-15961622
]
ASF GitHub Bot commented on BEAM-1832:
--------------------------------------
GitHub user rekhajoshm opened a pull request:
https://github.com/apache/beam/pull/2469
[BEAM-1832] Fix for potentially unclosed streams in ApexYarnLauncher
[BEAM-1832] Fix for potentially unclosed streams in ApexYarnLauncher
Using try-resources to handle closeable close issue
Removed redundant semicolons, string null assignment
Checkstyle passes. mvn clean verify passes.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rekhajoshm/beam BEAM-1832-1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/beam/pull/2469.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2469
----
commit ca4fae4d26da8c222209352dca35b1f54a6263de
Author: rjoshi2 <[email protected]>
Date: 2017-04-08T01:12:09Z
Fix for potentially unclosed streams in ApexYarnLauncher
----
> Potentially unclosed OutputStream in ApexYarnLauncher
> -----------------------------------------------------
>
> Key: BEAM-1832
> URL: https://issues.apache.org/jira/browse/BEAM-1832
> Project: Beam
> Issue Type: Bug
> Components: runner-apex
> Reporter: Ted Yu
> Priority: Minor
>
> Here is an example from createJar():
> {code}
> final OutputStream out =
> Files.newOutputStream(zipfs.getPath(JarFile.MANIFEST_NAME));
> if (!manifestFile.exists()) {
> new Manifest().write(out);
> } else {
> FileUtils.copyFile(manifestFile, out);
> }
> out.close();
> {code}
> If FileUtils.copyFile throws IOException, out would be left unclosed.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)