提交 f2e9c521 编写于 作者: M MaBiao 提交者: Maximilian Michels

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

This closes #2132
上级 e6320a4c
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册