public SerializationManagerImpl() { myFile.getParentFile().mkdirs(); try { // we need to cache last id -> String mappings due to StringRefs and stubs indexing that initially creates stubs (doing enumerate on String) // and then index them (valueOf), also similar string items are expected to be enumerated during stubs processing myNameStorage = new PersistentStringEnumerator(myFile, true); myStubSerializationHelper = new StubSerializationHelper(myNameStorage); } catch (IOException e) { nameStorageCrashed(); LOG.info(e); repairNameStorage(); // need this in order for myNameStorage not to be null nameStorageCrashed(); } finally { registerSerializer(PsiFileStubImpl.TYPE); ShutDownTracker.getInstance().registerShutdownTask(new Runnable() { @Override public void run() { performShutdown(); } }); } }
DependencyContext(final File rootDir) throws IOException { final File file = getTableFile(rootDir, STRING_TABLE_NAME); myEnumerator = new PersistentStringEnumerator(file, true); myEmptyName = myEnumerator.enumerate(""); }