提交 43f6cfcc authored 作者: Noel Grandin's avatar Noel Grandin

Resource leak in Recover tool #1177

上级 0b736985
......@@ -340,14 +340,13 @@ public class Recover extends Tool implements DataHandler {
} else if (fileName.endsWith(Constants.SUFFIX_MV_FILE)) {
String f = fileName.substring(0, fileName.length() -
Constants.SUFFIX_PAGE_FILE.length());
PrintWriter writer;
writer = getWriter(fileName, ".txt");
try (PrintWriter writer = getWriter(fileName, ".txt")) {
MVStoreTool.dump(fileName, writer, true);
MVStoreTool.info(fileName, writer);
writer.close();
writer = getWriter(f + ".h2.db", ".sql");
}
try (PrintWriter writer = getWriter(f + ".h2.db", ".sql")) {
dumpMVStoreFile(writer, fileName);
writer.close();
}
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论