IDEA-100777 Tasks no longer Persist Context: closing archives

This commit is contained in:
Dmitry Avdeev
2013-02-28 15:46:57 +04:00
parent dda2c66bb3
commit fc5abf3666
@@ -117,8 +117,9 @@ public class WorkingContextManager {
}
private synchronized void saveContext(@Nullable String entryName, String zipPostfix, @Nullable String comment) {
JBZipFile archive = null;
try {
JBZipFile archive = getTasksArchive(zipPostfix);
archive = getTasksArchive(zipPostfix);
if (entryName == null) {
int i = archive.getEntries().size();
do {
@@ -133,11 +134,13 @@ public class WorkingContextManager {
saveContext(element);
String s = new XMLOutputter().outputString(element);
entry.setData(s.getBytes("UTF-8"));
archive.close();
}
catch (IOException e) {
LOG.error(e);
}
finally {
closeArchive(archive);
}
}
private JBZipFile getTasksArchive(String postfix) throws IOException {