提交 1679f435 authored 作者: noelgrandin's avatar noelgrandin

revert part of my change, Eclipse's resource-close-warning is not that great IMO

上级 24162d15
......@@ -31,9 +31,10 @@ public class Profile extends Thread {
private BufferedWriter trace;
private Profile() {
LineNumberReader r = null;
FileReader reader = null;
try {
r = new LineNumberReader(new FileReader("profile.txt"));
reader = new FileReader("profile.txt");
LineNumberReader r = new LineNumberReader(reader);
while (r.readLine() != null) {
// nothing - just count lines
}
......@@ -46,7 +47,7 @@ public class Profile extends Thread {
e.printStackTrace();
System.exit(1);
} finally {
closeSilently(r);
closeSilently(reader);
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论