StorageManager API does not use Computable and Function and more
This commit is contained in:
committed by
Alexander Udalov
parent
7d1c46ed2c
commit
239ca9728d
+3
-3
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.jetbrains.jet.descriptors.serialization;
|
||||
|
||||
import com.intellij.util.Function;
|
||||
import jet.Function1;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationDeserializer;
|
||||
@@ -38,9 +38,9 @@ public abstract class AbstractDescriptorFinder implements DescriptorFinder {
|
||||
) {
|
||||
this.annotationDeserializer = annotationDeserializer;
|
||||
|
||||
this.findClass = storageManager.createMemoizedFunctionWithNullableValues(new Function<ClassId, ClassDescriptor>() {
|
||||
this.findClass = storageManager.createMemoizedFunctionWithNullableValues(new Function1<ClassId, ClassDescriptor>() {
|
||||
@Override
|
||||
public ClassDescriptor fun(ClassId classId) {
|
||||
public ClassDescriptor invoke(ClassId classId) {
|
||||
ClassData classData = getClassData(classId);
|
||||
if (classData == null) {
|
||||
return null;
|
||||
|
||||
+11
-11
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.jetbrains.jet.descriptors.serialization;
|
||||
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.util.Function;
|
||||
import gnu.trove.TIntObjectHashMap;
|
||||
import jet.Function0;
|
||||
import jet.Function1;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedTypeParameterDescriptor;
|
||||
@@ -26,12 +26,12 @@ import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassifierDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.storage.MemoizedFunctionToNullable;
|
||||
import org.jetbrains.jet.storage.NotNullLazyValue;
|
||||
import org.jetbrains.jet.storage.StorageManager;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
||||
import org.jetbrains.jet.storage.MemoizedFunctionToNullable;
|
||||
import org.jetbrains.jet.storage.NotNullLazyValue;
|
||||
import org.jetbrains.jet.storage.StorageManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -94,9 +94,9 @@ public class TypeDeserializer {
|
||||
typeParameterDescriptors.put(typeParameterDescriptor.getProtoId(), typeParameterDescriptor);
|
||||
}
|
||||
|
||||
this.classDescriptors = storageManager.createMemoizedFunctionWithNullableValues(new Function<Integer, ClassDescriptor>() {
|
||||
this.classDescriptors = storageManager.createMemoizedFunctionWithNullableValues(new Function1<Integer, ClassDescriptor>() {
|
||||
@Override
|
||||
public ClassDescriptor fun(Integer fqNameIndex) {
|
||||
public ClassDescriptor invoke(Integer fqNameIndex) {
|
||||
return computeClassDescriptor(fqNameIndex);
|
||||
}
|
||||
}, STRONG);
|
||||
@@ -210,15 +210,15 @@ public class TypeDeserializer {
|
||||
this.typeProto = proto;
|
||||
this.arguments = typeArguments(proto.getArgumentList());
|
||||
|
||||
this.constructor = storageManager.createLazyValue(new Computable<TypeConstructor>() {
|
||||
this.constructor = storageManager.createLazyValue(new Function0<TypeConstructor>() {
|
||||
@Override
|
||||
public TypeConstructor compute() {
|
||||
public TypeConstructor invoke() {
|
||||
return typeConstructor(typeProto);
|
||||
}
|
||||
});
|
||||
this.memberScope = storageManager.createLazyValue(new Computable<JetScope>() {
|
||||
this.memberScope = storageManager.createLazyValue(new Function0<JetScope>() {
|
||||
@Override
|
||||
public JetScope compute() {
|
||||
public JetScope invoke() {
|
||||
return computeMemberScope();
|
||||
}
|
||||
});
|
||||
|
||||
+16
-16
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.jetbrains.jet.descriptors.serialization.descriptors;
|
||||
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.util.Function;
|
||||
import jet.Function0;
|
||||
import jet.Function1;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.descriptors.serialization.*;
|
||||
@@ -26,10 +26,6 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.*;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorFactory;
|
||||
import org.jetbrains.jet.lang.resolve.OverridingUtil;
|
||||
import org.jetbrains.jet.storage.MemoizedFunctionToNullable;
|
||||
import org.jetbrains.jet.storage.NotNullLazyValue;
|
||||
import org.jetbrains.jet.storage.NullableLazyValue;
|
||||
import org.jetbrains.jet.storage.StorageManager;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.InnerClassesScopeWrapper;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
@@ -39,6 +35,10 @@ import org.jetbrains.jet.lang.types.ErrorUtils;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeConstructor;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.storage.MemoizedFunctionToNullable;
|
||||
import org.jetbrains.jet.storage.NotNullLazyValue;
|
||||
import org.jetbrains.jet.storage.NullableLazyValue;
|
||||
import org.jetbrains.jet.storage.StorageManager;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -96,9 +96,9 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
|
||||
this.deserializer = outerDeserializer.createChildDeserializer(this, classProto.getTypeParameterList(), typeParameters);
|
||||
this.typeDeserializer = deserializer.getTypeDeserializer();
|
||||
|
||||
this.containingDeclaration = storageManager.createLazyValue(new Computable<DeclarationDescriptor>() {
|
||||
this.containingDeclaration = storageManager.createLazyValue(new Function0<DeclarationDescriptor>() {
|
||||
@Override
|
||||
public DeclarationDescriptor compute() {
|
||||
public DeclarationDescriptor invoke() {
|
||||
return computeContainingDeclaration();
|
||||
}
|
||||
});
|
||||
@@ -115,23 +115,23 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
|
||||
this.isInner = Flags.INNER.get(flags);
|
||||
|
||||
this.annotationDeserializer = annotationResolver;
|
||||
this.annotations = storageManager.createLazyValue(new Computable<List<AnnotationDescriptor>>() {
|
||||
this.annotations = storageManager.createLazyValue(new Function0<List<AnnotationDescriptor>>() {
|
||||
@Override
|
||||
public List<AnnotationDescriptor> compute() {
|
||||
public List<AnnotationDescriptor> invoke() {
|
||||
return computeAnnotations();
|
||||
}
|
||||
});
|
||||
|
||||
this.primaryConstructor = storageManager.createNullableLazyValue(new Computable<ConstructorDescriptor>() {
|
||||
this.primaryConstructor = storageManager.createNullableLazyValue(new Function0<ConstructorDescriptor>() {
|
||||
@Override
|
||||
public ConstructorDescriptor compute() {
|
||||
public ConstructorDescriptor invoke() {
|
||||
return computePrimaryConstructor();
|
||||
}
|
||||
});
|
||||
|
||||
this.classObjectDescriptor = storageManager.createNullableLazyValue(new Computable<ClassDescriptor>() {
|
||||
this.classObjectDescriptor = storageManager.createNullableLazyValue(new Function0<ClassDescriptor>() {
|
||||
@Override
|
||||
public ClassDescriptor compute() {
|
||||
public ClassDescriptor invoke() {
|
||||
return computeClassObjectDescriptor();
|
||||
}
|
||||
});
|
||||
@@ -490,9 +490,9 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
|
||||
|
||||
public NestedClassDescriptors(@NotNull StorageManager storageManager, @NotNull Set<Name> declaredNames) {
|
||||
this.declaredNames = declaredNames;
|
||||
this.findClass = storageManager.createMemoizedFunctionWithNullableValues(new Function<Name, ClassDescriptor>() {
|
||||
this.findClass = storageManager.createMemoizedFunctionWithNullableValues(new Function1<Name, ClassDescriptor>() {
|
||||
@Override
|
||||
public ClassDescriptor fun(Name name) {
|
||||
public ClassDescriptor invoke(Name name) {
|
||||
return NestedClassDescriptors.this.declaredNames.contains(name) ?
|
||||
descriptorFinder.findClass(classId.createNestedClassId(name)) :
|
||||
null;
|
||||
|
||||
+13
-13
@@ -16,20 +16,20 @@
|
||||
|
||||
package org.jetbrains.jet.descriptors.serialization.descriptors;
|
||||
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.util.Function;
|
||||
import jet.Function0;
|
||||
import jet.Function1;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.descriptors.serialization.DescriptorDeserializer;
|
||||
import org.jetbrains.jet.descriptors.serialization.Flags;
|
||||
import org.jetbrains.jet.descriptors.serialization.ProtoBuf;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.storage.MemoizedFunctionToNotNull;
|
||||
import org.jetbrains.jet.storage.NotNullLazyValue;
|
||||
import org.jetbrains.jet.storage.StorageManager;
|
||||
import org.jetbrains.jet.lang.resolve.name.LabelName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.storage.MemoizedFunctionToNotNull;
|
||||
import org.jetbrains.jet.storage.NotNullLazyValue;
|
||||
import org.jetbrains.jet.storage.StorageManager;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -73,27 +73,27 @@ public abstract class DeserializedMemberScope implements JetScope {
|
||||
this.deserializer = deserializer;
|
||||
|
||||
this.membersProtos = groupByName(membersList);
|
||||
this.functions = storageManager.createMemoizedFunction(new Function<Name, Collection<FunctionDescriptor>>() {
|
||||
this.functions = storageManager.createMemoizedFunction(new Function1<Name, Collection<FunctionDescriptor>>() {
|
||||
@Override
|
||||
public Collection<FunctionDescriptor> fun(Name name) {
|
||||
public Collection<FunctionDescriptor> invoke(Name name) {
|
||||
return computeFunctions(name);
|
||||
}
|
||||
}, STRONG);
|
||||
this.properties = storageManager.createMemoizedFunction(new Function<Name, Collection<VariableDescriptor>>() {
|
||||
this.properties = storageManager.createMemoizedFunction(new Function1<Name, Collection<VariableDescriptor>>() {
|
||||
@Override
|
||||
public Collection<VariableDescriptor> fun(Name name) {
|
||||
public Collection<VariableDescriptor> invoke(Name name) {
|
||||
return computeProperties(name);
|
||||
}
|
||||
}, STRONG);
|
||||
this.allDescriptors = storageManager.createLazyValue(new Computable<Collection<DeclarationDescriptor>>() {
|
||||
this.allDescriptors = storageManager.createLazyValue(new Function0<Collection<DeclarationDescriptor>>() {
|
||||
@Override
|
||||
public Collection<DeclarationDescriptor> compute() {
|
||||
public Collection<DeclarationDescriptor> invoke() {
|
||||
return computeAllDescriptors();
|
||||
}
|
||||
});
|
||||
this.objectDescriptors = storageManager.createLazyValue(new Computable<Collection<ClassDescriptor>>() {
|
||||
this.objectDescriptors = storageManager.createLazyValue(new Function0<Collection<ClassDescriptor>>() {
|
||||
@Override
|
||||
public Collection<ClassDescriptor> compute() {
|
||||
public Collection<ClassDescriptor> invoke() {
|
||||
return computeAllObjectDescriptors();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user