commit | cf4d6172b7d4ba263ba8e0114a69dc7c4f801a24 | [log] [tgz] |
---|---|---|
author | HIGUCHI Yuta <y-higuchi@ak.jp.nec.com> | Tue Sep 22 16:39:33 2015 -0700 |
committer | Gerrit Code Review <gerrit@onlab.us> | Fri Sep 25 19:21:44 2015 +0000 |
tree | 1912272fb779f38884746420caa7651fe9a84cea | |
parent | 9bb3235f0b2c4db61695337076e677e18177abdc [diff] |
Fix resource leak warning. Change-Id: I7aa926d8a62220a902e983b4b692abecd8f687e1
diff --git a/utils/misc/src/main/java/org/onlab/util/Tools.java b/utils/misc/src/main/java/org/onlab/util/Tools.java index abc48cc..11191d3 100644 --- a/utils/misc/src/main/java/org/onlab/util/Tools.java +++ b/utils/misc/src/main/java/org/onlab/util/Tools.java
@@ -301,10 +301,10 @@ * @return file contents */ public static List<String> slurp(File path) { - try { + try ( BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8)); - + ) { List<String> lines = new ArrayList<>(); String line; while ((line = br.readLine()) != null) {