diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/Mappings.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/Mappings.java index 46920c3dc377..b17f7b3dad27 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/Mappings.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/Mappings.java @@ -5,7 +5,7 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.io.FileUtil; -import com.intellij.util.io.IntInlineKeyDescriptor; +import com.intellij.util.io.EnumeratorIntegerDescriptor; import gnu.trove.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -35,7 +35,6 @@ public class Mappings { private final static String SHORT_NAMES = "shortNames.tab"; private final static String SOURCE_TO_CLASS = "sourceToClass.tab"; private final static String CLASS_TO_SOURCE = "classToSource.tab"; - private static final IntInlineKeyDescriptor INT_KEY_DESCRIPTOR = new IntInlineKeyDescriptor(); private static final int DEFAULT_SET_CAPACITY = 32; private static final float DEFAULT_SET_LOAD_FACTOR = 0.98f; private static final String IMPORT_WILDCARD_SUFFIX = ".*"; @@ -136,15 +135,18 @@ public class Mappings { if (myIsDelta) { myRootDir.mkdirs(); } - myClassToSubclasses = new IntIntPersistentMultiMaplet(DependencyContext.getTableFile(myRootDir, CLASS_TO_SUBCLASSES), INT_KEY_DESCRIPTOR); - myClassToClassDependency = new IntIntPersistentMultiMaplet(DependencyContext.getTableFile(myRootDir, CLASS_TO_CLASS), INT_KEY_DESCRIPTOR); - myShortClassNameIndex = myIsDelta? null : new IntIntPersistentMultiMaplet(DependencyContext.getTableFile(myRootDir, SHORT_NAMES), INT_KEY_DESCRIPTOR); + myClassToSubclasses = new IntIntPersistentMultiMaplet(DependencyContext.getTableFile(myRootDir, CLASS_TO_SUBCLASSES), + EnumeratorIntegerDescriptor.INSTANCE); + myClassToClassDependency = new IntIntPersistentMultiMaplet(DependencyContext.getTableFile(myRootDir, CLASS_TO_CLASS), + EnumeratorIntegerDescriptor.INSTANCE); + myShortClassNameIndex = myIsDelta? null : new IntIntPersistentMultiMaplet(DependencyContext.getTableFile(myRootDir, SHORT_NAMES), + EnumeratorIntegerDescriptor.INSTANCE); mySourceFileToClasses = new ObjectObjectPersistentMultiMaplet<>( DependencyContext.getTableFile(myRootDir, SOURCE_TO_CLASS), new FileKeyDescriptor(), new ClassFileReprExternalizer(myContext), () -> new THashSet<>(5, DEFAULT_SET_LOAD_FACTOR) ); myClassToSourceFile = new IntObjectPersistentMultiMaplet<>( - DependencyContext.getTableFile(myRootDir, CLASS_TO_SOURCE), INT_KEY_DESCRIPTOR, new FileKeyDescriptor(), fileCollectionFactory + DependencyContext.getTableFile(myRootDir, CLASS_TO_SOURCE), EnumeratorIntegerDescriptor.INSTANCE, new FileKeyDescriptor(), fileCollectionFactory ); } } diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/OutputToTargetRegistry.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/OutputToTargetRegistry.java index 8e28bb77401a..a9cbca19dff9 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/OutputToTargetRegistry.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/OutputToTargetRegistry.java @@ -4,6 +4,7 @@ package org.jetbrains.jps.incremental.storage; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.io.FileUtil; import com.intellij.util.io.DataExternalizer; +import com.intellij.util.io.EnumeratorIntegerDescriptor; import com.intellij.util.io.IntInlineKeyDescriptor; import gnu.trove.TIntHashSet; import org.jetbrains.annotations.NotNull; @@ -49,7 +50,7 @@ public class OutputToTargetRegistry extends AbstractStateStorage DATA_DESCRIPTOR = new IntInlineKeyDescriptor(); - @NotNull @Override public ID getName() { @@ -326,7 +324,7 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi @NotNull @Override public KeyDescriptor getKeyDescriptor() { - return DATA_DESCRIPTOR; + return EnumeratorIntegerDescriptor.INSTANCE; } @NotNull diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogPathsIndex.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogPathsIndex.java index 42015dd8c4a4..53c0d881d158 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogPathsIndex.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogPathsIndex.java @@ -65,7 +65,7 @@ public class VcsLogPathsIndex extends VcsLogFullDetailsIndex>> createMap() throws IOException { File storageFile = myStorageId.getStorageFile(myName + ".idx"); - return new PersistentHashMap<>(storageFile, new IntInlineKeyDescriptor(), new IntCollectionListExternalizer(), Page.PAGE_SIZE); + return new PersistentHashMap<>(storageFile, EnumeratorIntegerDescriptor.INSTANCE, new IntCollectionListExternalizer(), Page.PAGE_SIZE); } }; } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogPersistentIndex.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogPersistentIndex.java index ea9ceec25a11..c470a631c91d 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogPersistentIndex.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogPersistentIndex.java @@ -339,7 +339,7 @@ public class VcsLogPersistentIndex implements VcsLogModifiableIndex, Disposable Disposer.register(this, () -> catchAndWarn(commits::close)); File messagesStorage = new StorageId(INDEX, logId, VcsLogStorageImpl.VERSION + MESSAGES_VERSION).getStorageFile(MESSAGES); - messages = new PersistentHashMap<>(messagesStorage, new IntInlineKeyDescriptor(), EnumeratorStringDescriptor.INSTANCE, + messages = new PersistentHashMap<>(messagesStorage, EnumeratorIntegerDescriptor.INSTANCE, EnumeratorStringDescriptor.INSTANCE, Page.PAGE_SIZE); Disposer.register(this, () -> catchAndWarn(messages::close)); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogUserIndex.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogUserIndex.java index 9717bbb034b7..4d81bd362ce1 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogUserIndex.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogUserIndex.java @@ -70,7 +70,7 @@ public class VcsLogUserIndex extends VcsLogFullDetailsIndex> createMap() throws IOException { File storageFile = myStorageId.getStorageFile(myName + ".idx"); - return new PersistentHashMap<>(storageFile, new IntInlineKeyDescriptor(), new IntCollectionDataExternalizer(), Page.PAGE_SIZE); + return new PersistentHashMap<>(storageFile, EnumeratorIntegerDescriptor.INSTANCE, new IntCollectionDataExternalizer(), Page.PAGE_SIZE); } }; }