mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
save version for snapshots_info after io initialization problem
This commit is contained in:
@@ -257,16 +257,7 @@ public class JarHandler extends ZipHandler {
|
||||
|
||||
if (currentVersion != VERSION) {
|
||||
PersistentHashMap.deleteFilesStartingWith(file);
|
||||
DataOutputStream versionOutputStream = null;
|
||||
try {
|
||||
versionOutputStream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(versionFile)));
|
||||
DataInputOutputUtil.writeINT(versionOutputStream, VERSION);
|
||||
} catch (IOException ignore) {}
|
||||
finally {
|
||||
try {
|
||||
if (versionOutputStream != null) versionOutputStream.close();
|
||||
} catch (IOException ignore) {}
|
||||
}
|
||||
saveVersion(versionFile);
|
||||
}
|
||||
|
||||
PersistentHashMap<String, CacheLibraryInfo> info = null;
|
||||
@@ -291,6 +282,7 @@ public class JarHandler extends ZipHandler {
|
||||
break;
|
||||
} catch (IOException ex) {
|
||||
PersistentHashMap.deleteFilesStartingWith(file);
|
||||
saveVersion(versionFile);
|
||||
}
|
||||
}
|
||||
assert info != null;
|
||||
@@ -310,6 +302,19 @@ public class JarHandler extends ZipHandler {
|
||||
});
|
||||
}
|
||||
|
||||
private static void saveVersion(File versionFile) {
|
||||
DataOutputStream versionOutputStream = null;
|
||||
try {
|
||||
versionOutputStream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(versionFile)));
|
||||
DataInputOutputUtil.writeINT(versionOutputStream, VERSION);
|
||||
} catch (IOException ignore) {}
|
||||
finally {
|
||||
try {
|
||||
if (versionOutputStream != null) versionOutputStream.close();
|
||||
} catch (IOException ignore) {}
|
||||
}
|
||||
}
|
||||
|
||||
private static void flushCachedLibraryInfos() {
|
||||
if (ourCachedLibraryInfo.isDirty()) ourCachedLibraryInfo.force();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user