Repository: cassandra Updated Branches: refs/heads/trunk a7c9fa0f1 -> 387ba4f30
close streams Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/387ba4f3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/387ba4f3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/387ba4f3 Branch: refs/heads/trunk Commit: 387ba4f309d38223769a3d9501f6baada4ded8bf Parents: a7c9fa0 Author: Dave Brosius <dbros...@mebigfatguy.com> Authored: Thu Mar 2 21:22:11 2017 -0500 Committer: Dave Brosius <dbros...@mebigfatguy.com> Committed: Thu Mar 2 21:22:11 2017 -0500 ---------------------------------------------------------------------- tools/stress/src/org/apache/cassandra/stress/StressGraph.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/387ba4f3/tools/stress/src/org/apache/cassandra/stress/StressGraph.java ---------------------------------------------------------------------- diff --git a/tools/stress/src/org/apache/cassandra/stress/StressGraph.java b/tools/stress/src/org/apache/cassandra/stress/StressGraph.java index 663bde6..6729a28 100644 --- a/tools/stress/src/org/apache/cassandra/stress/StressGraph.java +++ b/tools/stress/src/org/apache/cassandra/stress/StressGraph.java @@ -110,17 +110,14 @@ public class StressGraph private String getGraphHTML() { - InputStream graphHTMLRes = StressGraph.class.getClassLoader().getResourceAsStream("org/apache/cassandra/stress/graph/graph.html"); - String graphHTML; - try + try (InputStream graphHTMLRes = StressGraph.class.getClassLoader().getResourceAsStream("org/apache/cassandra/stress/graph/graph.html")) { - graphHTML = new String(ByteStreams.toByteArray(graphHTMLRes)); + return new String(ByteStreams.toByteArray(graphHTMLRes)); } catch (IOException e) { throw new RuntimeException(e); } - return graphHTML; } /** Parse log and append to stats array */