StorageManager API does not use Computable and Function and more

This commit is contained in:
Andrey Breslav
2013-10-04 19:52:17 +04:00
committed by Alexander Udalov
parent 7d1c46ed2c
commit 239ca9728d
29 changed files with 284 additions and 269 deletions
@@ -16,7 +16,7 @@
package org.jetbrains.jet.lang.descriptors.impl;
import com.intellij.openapi.util.Computable;
import jet.Function0;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.ClassifierDescriptor;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
@@ -65,27 +65,27 @@ public abstract class AbstractLazyTypeParameterDescriptor implements TypeParamet
this.name = name;
this.reified = isReified;
this.typeConstructor = storageManager.createLazyValue(new Computable<TypeConstructor>() {
this.typeConstructor = storageManager.createLazyValue(new Function0<TypeConstructor>() {
@Override
public TypeConstructor compute() {
public TypeConstructor invoke() {
return createTypeConstructor();
}
});
this.defaultType = storageManager.createLazyValue(new Computable<JetType>() {
this.defaultType = storageManager.createLazyValue(new Function0<JetType>() {
@Override
public JetType compute() {
public JetType invoke() {
return createDefaultType(storageManager);
}
});
this.upperBounds = storageManager.createLazyValue(new Computable<Set<JetType>>() {
this.upperBounds = storageManager.createLazyValue(new Function0<Set<JetType>>() {
@Override
public Set<JetType> compute() {
public Set<JetType> invoke() {
return resolveUpperBounds();
}
});
this.upperBoundsAsType = storageManager.createLazyValue(new Computable<JetType>() {
this.upperBoundsAsType = storageManager.createLazyValue(new Function0<JetType>() {
@Override
public JetType compute() {
public JetType invoke() {
return computeUpperBoundsAsType();
}
});
@@ -198,9 +198,9 @@ public abstract class AbstractLazyTypeParameterDescriptor implements TypeParamet
@NotNull
private JetType createDefaultType(@NotNull StorageManager storageManager) {
return new JetTypeImpl(getTypeConstructor(), new LazyScopeAdapter(storageManager.createLazyValue(
new Computable<JetScope>() {
new Function0<JetScope>() {
@Override
public JetScope compute() {
public JetScope invoke() {
return getUpperBoundsAsType().getMemberScope();
}
}
@@ -17,7 +17,7 @@
package org.jetbrains.jet.lang.descriptors.impl;
import com.google.common.collect.Sets;
import com.intellij.openapi.util.Computable;
import jet.Function0;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptorVisitor;
@@ -224,9 +224,9 @@ public class TypeParameterDescriptorImpl extends DeclarationDescriptorNonRootImp
getTypeConstructor(),
TypeUtils.hasNullableLowerBound(this),
Collections.<TypeProjection>emptyList(),
new LazyScopeAdapter(NO_LOCKS.createLazyValue(new Computable<JetScope>() {
new LazyScopeAdapter(NO_LOCKS.createLazyValue(new Function0<JetScope>() {
@Override
public JetScope compute() {
public JetScope invoke() {
return getUpperBoundsAsType().getMemberScope();
}
})));
@@ -1,6 +1,6 @@
package org.jetbrains.jet.lang.types.lang;
import com.intellij.openapi.util.Computable;
import jet.Function0;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.descriptors.serialization.*;
@@ -8,11 +8,11 @@ import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedPacka
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
import org.jetbrains.jet.lang.descriptors.impl.AbstractNamespaceDescriptorImpl;
import org.jetbrains.jet.storage.NotNullLazyValue;
import org.jetbrains.jet.storage.StorageManager;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.lang.resolve.name.Name;
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
import org.jetbrains.jet.storage.NotNullLazyValue;
import org.jetbrains.jet.storage.StorageManager;
import java.io.DataInputStream;
import java.io.IOException;
@@ -81,10 +81,10 @@ class BuiltinsNamespaceDescriptorImpl extends AbstractNamespaceDescriptorImpl {
public BuiltInsDescriptorFinder(@NotNull StorageManager storageManager) {
super(storageManager, UNSUPPORTED);
classNames = storageManager.createLazyValue(new Computable<Collection<Name>>() {
classNames = storageManager.createLazyValue(new Function0<Collection<Name>>() {
@Override
@NotNull
public Collection<Name> compute() {
public Collection<Name> invoke() {
InputStream in = getStream(BuiltInsSerializationUtil.getClassNamesFilePath(BuiltinsNamespaceDescriptorImpl.this));
try {