diff --git a/platform/util/src/com/intellij/util/io/PersistentMapImpl.java b/platform/util/src/com/intellij/util/io/PersistentMapImpl.java index 233de80ecde0..a50d2be1b782 100644 --- a/platform/util/src/com/intellij/util/io/PersistentMapImpl.java +++ b/platform/util/src/com/intellij/util/io/PersistentMapImpl.java @@ -253,11 +253,11 @@ public final class PersistentMapImpl implements PersistentMapBase getKeyDescriptor(){ + public @NotNull KeyDescriptor getKeyDescriptor() { return myKeyDescriptor; } - public @NotNull PersistentMapBuilder builder(){ + public @NotNull PersistentMapBuilder builder() { //builder is mutable, so return a copy of it: return myBuilder.copy(); } @@ -720,22 +720,22 @@ public final class PersistentMapImpl implements PersistentMapBase)myEnumerator).getNonNegativeValue(key) != NULL_ADDR; - } - else { - final int id = myEnumerator.tryEnumerate(key); + if (myDirectlyStoreLongFileOffsetMode) { + return ((PersistentBTreeEnumerator)myEnumerator).getNonNegativeValue(key) != NULL_ADDR; + } + else { + myEnumerator.lockStorageRead(); + try { + int id = myEnumerator.tryEnumerate(key); if (id == DataEnumerator.NULL_ID) { return false; } if (myIntMapping) return true; return readValueId(id) != NULL_ADDR; } - } - finally { - myEnumerator.unlockStorageRead(); + finally { + myEnumerator.unlockStorageRead(); + } } }