mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use singleton instead of new
This commit is contained in:
+1
-1
@@ -584,7 +584,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
}
|
||||
|
||||
private void initOutputRootsFile(File rootsFile) throws IOException {
|
||||
myOutputRootsStorage = new PersistentHashMap<Integer, TIntObjectHashMap<Pair<Integer, Integer>>>(rootsFile, new EnumeratorIntegerDescriptor(), new DataExternalizer<TIntObjectHashMap<Pair<Integer, Integer>>>() {
|
||||
myOutputRootsStorage = new PersistentHashMap<Integer, TIntObjectHashMap<Pair<Integer, Integer>>>(rootsFile, EnumeratorIntegerDescriptor.INSTANCE, new DataExternalizer<TIntObjectHashMap<Pair<Integer, Integer>>>() {
|
||||
public void save(DataOutput out, TIntObjectHashMap<Pair<Integer, Integer>> value) throws IOException {
|
||||
for (final TIntObjectIterator<Pair<Integer, Integer>> it = value.iterator(); it.hasNext();) {
|
||||
it.advance();
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BackwardDependenciesStorage implements Flushable, Disposable {
|
||||
private static final int CLASS = 3;
|
||||
|
||||
public BackwardDependenciesStorage(File file, final int cacheSize) throws IOException {
|
||||
myMap = new PersistentHashMap<Integer, DependenciesSet>(file, new EnumeratorIntegerDescriptor(), new MyDataExternalizer());
|
||||
myMap = new PersistentHashMap<Integer, DependenciesSet>(file, EnumeratorIntegerDescriptor.INSTANCE, new MyDataExternalizer());
|
||||
|
||||
myCache = new SLRUCache<Integer, ReferencerSetHolder>(cacheSize * 2, cacheSize) {
|
||||
@NotNull
|
||||
|
||||
@@ -29,6 +29,6 @@ public abstract class IntStubIndexExtension<Psi extends PsiElement> extends Abst
|
||||
}
|
||||
|
||||
public KeyDescriptor<Integer> getKeyDescriptor() {
|
||||
return new EnumeratorIntegerDescriptor();
|
||||
return EnumeratorIntegerDescriptor.INSTANCE;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class TrigramIndex extends ScalarIndexExtension<Integer> {
|
||||
|
||||
@Override
|
||||
public KeyDescriptor<Integer> getKeyDescriptor() {
|
||||
return new EnumeratorIntegerDescriptor();
|
||||
return EnumeratorIntegerDescriptor.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -532,7 +532,7 @@ public class FileBasedIndex implements ApplicationComponent {
|
||||
// cleared properly before updating (removed data will still be present on disk). See IDEA-52223 for illustration of possible effects.
|
||||
|
||||
final PersistentHashMap<Integer, Collection<K>> map = new PersistentHashMap<Integer, Collection<K>>(
|
||||
indexStorageFile, new EnumeratorIntegerDescriptor(), dataExternalizer
|
||||
indexStorageFile, EnumeratorIntegerDescriptor.INSTANCE, dataExternalizer
|
||||
) {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -96,7 +96,7 @@ public class AntImportsIndex extends ScalarIndexExtension<Integer>{
|
||||
}
|
||||
|
||||
public KeyDescriptor<Integer> getKeyDescriptor() {
|
||||
return new EnumeratorIntegerDescriptor();
|
||||
return EnumeratorIntegerDescriptor.INSTANCE;
|
||||
}
|
||||
|
||||
public FileBasedIndex.InputFilter getInputFilter() {
|
||||
|
||||
Reference in New Issue
Block a user