Updated Branches: refs/heads/trunk 9cdc755f8 -> e6b4fcf24
close streams Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e6b4fcf2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e6b4fcf2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e6b4fcf2 Branch: refs/heads/trunk Commit: e6b4fcf24c46019dae955aba54939ad18afad8ba Parents: 9cdc755 Author: Dave Brosius <[email protected]> Authored: Sun Oct 27 21:41:54 2013 -0400 Committer: Dave Brosius <[email protected]> Committed: Sun Oct 27 21:41:54 2013 -0400 ---------------------------------------------------------------------- test/unit/org/apache/pig/test/MiniCluster.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6b4fcf2/test/unit/org/apache/pig/test/MiniCluster.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/pig/test/MiniCluster.java b/test/unit/org/apache/pig/test/MiniCluster.java index 3216392..e8f1f6e 100644 --- a/test/unit/org/apache/pig/test/MiniCluster.java +++ b/test/unit/org/apache/pig/test/MiniCluster.java @@ -20,6 +20,7 @@ package org.apache.pig.test; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.MiniDFSCluster; @@ -59,7 +60,10 @@ public class MiniCluster extends MiniGenericCluster { m_conf.set("mapred.map.max.attempts", "2"); m_conf.set("mapred.reduce.max.attempts", "2"); m_conf.set("pig.jobcontrol.sleep", "100"); - m_conf.writeXml(new FileOutputStream(conf_file)); + try (OutputStream os = new FileOutputStream(conf_file)) + { + m_conf.writeXml(os); + } // Set the system properties needed by Pig System.setProperty("cluster", m_conf.get("mapred.job.tracker"));
