mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
re-fix for read-only indices (rewrite assignment of read-only status for ValueContainerMap)
This commit is contained in:
@@ -80,7 +80,12 @@ public abstract class MapIndexStorage<Key, Value> implements IndexStorage<Key, V
|
||||
});
|
||||
PersistentHashMapValueStorage.CreationTimeOptions.COMPACT_CHUNKS_WITH_VALUE_DESERIALIZATION.set(Boolean.TRUE);
|
||||
try {
|
||||
map = new ValueContainerMap<Key, Value>(getStorageFile(), myKeyDescriptor, myDataExternalizer, myKeyIsUniqueForIndexedFile, myReadOnly);
|
||||
map = new ValueContainerMap<Key, Value>(getStorageFile(), myKeyDescriptor, myDataExternalizer, myKeyIsUniqueForIndexedFile) {
|
||||
@Override
|
||||
protected boolean isReadOnly() {
|
||||
return myReadOnly;
|
||||
}
|
||||
};
|
||||
} finally {
|
||||
PersistentHashMapValueStorage.CreationTimeOptions.EXCEPTIONAL_IO_CANCELLATION.set(null);
|
||||
PersistentHashMapValueStorage.CreationTimeOptions.COMPACT_CHUNKS_WITH_VALUE_DESERIALIZATION.set(null);
|
||||
|
||||
@@ -29,18 +29,14 @@ import java.io.*;
|
||||
class ValueContainerMap<Key, Value> extends PersistentHashMap<Key, UpdatableValueContainer<Value>> {
|
||||
@NotNull private final DataExternalizer<Value> myValueExternalizer;
|
||||
private final boolean myKeyIsUniqueForIndexedFile;
|
||||
private final boolean myReadOnly;
|
||||
|
||||
ValueContainerMap(@NotNull final File file,
|
||||
@NotNull KeyDescriptor<Key> keyKeyDescriptor,
|
||||
@NotNull DataExternalizer<Value> valueExternalizer,
|
||||
boolean keyIsUniqueForIndexedFile,
|
||||
boolean readOnly
|
||||
) throws IOException {
|
||||
boolean keyIsUniqueForIndexedFile) throws IOException {
|
||||
super(file, keyKeyDescriptor, new ValueContainerExternalizer<Value>(valueExternalizer));
|
||||
myValueExternalizer = valueExternalizer;
|
||||
myKeyIsUniqueForIndexedFile = keyIsUniqueForIndexedFile;
|
||||
myReadOnly = readOnly;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -71,11 +67,6 @@ class ValueContainerMap<Key, Value> extends PersistentHashMap<Key, UpdatableValu
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isReadOnly() {
|
||||
return myReadOnly;
|
||||
}
|
||||
|
||||
private static final class ValueContainerExternalizer<T> implements DataExternalizer<UpdatableValueContainer<T>> {
|
||||
@NotNull private final DataExternalizer<T> myValueExternalizer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user