提交 c9c2f91e authored 作者: Andrei Tokar's avatar Andrei Tokar

code review suggestions from @katzyn

上级 a9e71a03
...@@ -186,21 +186,20 @@ public class FileStore { ...@@ -186,21 +186,20 @@ public class FileStore {
* Close this store. * Close this store.
*/ */
public void close() { public void close() {
if(file != null && file.isOpen()) { try {
try { if(file != null && file.isOpen()) {
if (fileLock != null && fileLock.isValid()) { if (fileLock != null) {
fileLock.release(); fileLock.release();
} }
file.close(); file.close();
freeSpace.clear();
} catch (Exception e) {
throw DataUtils.newIllegalStateException(
DataUtils.ERROR_WRITING_FAILED,
"Closing failed for file {0}", fileName, e);
} finally {
fileLock = null;
file = null;
} }
} catch (Exception e) {
throw DataUtils.newIllegalStateException(
DataUtils.ERROR_WRITING_FAILED,
"Closing failed for file {0}", fileName, e);
} finally {
fileLock = null;
file = null;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论