Make MetaDataUpdate auto-closeable

And convert users to instantiate it in try-with-resource blocks.

Change-Id: Ief1a42ccbf4b3d943a7987b2c9b8077175695515
This commit is contained in:
David Pursehouse
2015-12-17 19:51:15 +09:00
parent b86ae4951f
commit 07b27d7b05
19 changed files with 148 additions and 227 deletions

View File

@@ -552,11 +552,8 @@ public abstract class AbstractDaemonTest {
protected void saveProjectConfig(Project.NameKey p, ProjectConfig cfg)
throws Exception {
MetaDataUpdate md = metaDataUpdateFactory.create(p);
try {
try (MetaDataUpdate md = metaDataUpdateFactory.create(p)) {
cfg.commit(md);
} finally {
md.close();
}
projectCache.evict(cfg.getProject());
}