You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by mx...@apache.org on 2016/06/20 15:21:06 UTC

flink git commit: [FLINK-4090] Close of OutputStream should be in finally clause

Repository: flink
Updated Branches:
  refs/heads/master e6320a4c3 -> f2e9c521a


[FLINK-4090] Close of OutputStream should be in finally clause

This closes #2132


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/f2e9c521
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/f2e9c521
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/f2e9c521

Branch: refs/heads/master
Commit: f2e9c521aa4e0cbc14b71c561b8c5dd46201a45a
Parents: e6320a4
Author: MaBiao <ma...@gmail.com>
Authored: Mon Jun 20 10:00:02 2016 +0800
Committer: Maximilian Michels <mx...@apache.org>
Committed: Mon Jun 20 17:21:54 2016 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/f2e9c521/flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java
----------------------------------------------------------------------
diff --git a/flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java b/flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java
index c355f0a..d59657d 100644
--- a/flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java
+++ b/flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java
@@ -367,10 +367,8 @@ public class FlinkYarnSessionCli implements CustomCommandLine<YarnClusterClient>
 	}
 
 	private static void writeYarnProperties(Properties properties, File propertiesFile) {
-		try {
-			OutputStream out = new FileOutputStream(propertiesFile);
+		try (final OutputStream out = new FileOutputStream(propertiesFile)) {
 			properties.store(out, "Generated YARN properties file");
-			out.close();
 		} catch (IOException e) {
 			throw new RuntimeException("Error writing the properties file", e);
 		}