Delete JetScope.getObjectDescriptor()

This commit is contained in:
Alexander Udalov
2013-11-15 22:09:47 +04:00
parent 550df37056
commit 4526d96186
20 changed files with 7 additions and 193 deletions
@@ -432,18 +432,6 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
protected void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
result.addAll(classDescriptor.nestedClasses.getAllDescriptors());
}
@Nullable
@Override
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
return null;
}
@NotNull
@Override
protected Collection<ClassDescriptor> computeAllObjectDescriptors() {
return Collections.emptySet();
}
}
private class NestedClassDescriptors {
@@ -59,7 +59,6 @@ public abstract class DeserializedMemberScope implements JetScope {
private final MemoizedFunctionToNotNull<Name, Collection<FunctionDescriptor>> functions;
private final MemoizedFunctionToNotNull<Name, Collection<VariableDescriptor>> properties;
private final NotNullLazyValue<Collection<DeclarationDescriptor>> allDescriptors;
private final NotNullLazyValue<Collection<ClassDescriptor>> objectDescriptors;
public DeserializedMemberScope(
@NotNull StorageManager storageManager,
@@ -89,12 +88,6 @@ public abstract class DeserializedMemberScope implements JetScope {
return computeAllDescriptors();
}
});
this.objectDescriptors = storageManager.createLazyValue(new Function0<Collection<ClassDescriptor>>() {
@Override
public Collection<ClassDescriptor> invoke() {
return computeAllObjectDescriptors();
}
});
}
@NotNull
@@ -172,13 +165,6 @@ public abstract class DeserializedMemberScope implements JetScope {
protected abstract void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result);
@Nullable
@Override
public abstract ClassDescriptor getObjectDescriptor(@NotNull Name name);
@NotNull
protected abstract Collection<ClassDescriptor> computeAllObjectDescriptors();
@Nullable
@Override
public NamespaceDescriptor getNamespace(@NotNull Name name) {
@@ -19,7 +19,10 @@ package org.jetbrains.jet.descriptors.serialization.descriptors;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.descriptors.serialization.*;
import org.jetbrains.jet.lang.descriptors.*;
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
import org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor;
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
@@ -27,7 +30,6 @@ import org.jetbrains.jet.lang.resolve.name.Name;
import org.jetbrains.jet.storage.StorageManager;
import java.util.Collection;
import java.util.Collections;
public class DeserializedPackageMemberScope extends DeserializedMemberScope {
private final DescriptorFinder descriptorFinder;
@@ -62,25 +64,14 @@ public class DeserializedPackageMemberScope extends DeserializedMemberScope {
@Nullable
@Override
protected ClassifierDescriptor getClassDescriptor(@NotNull Name name) {
return findClassDescriptor(name);
}
@Nullable
@Override
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
return null;
}
@Nullable
private ClassDescriptor findClassDescriptor(Name name) {
protected ClassDescriptor getClassDescriptor(@NotNull Name name) {
return descriptorFinder.findClass(new ClassId(packageFqName, FqNameUnsafe.topLevel(name)));
}
@Override
protected void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
for (Name className : descriptorFinder.getClassNames(packageFqName)) {
ClassDescriptor classDescriptor = findClassDescriptor(className);
ClassDescriptor classDescriptor = getClassDescriptor(className);
if (classDescriptor != null) {
result.add(classDescriptor);
@@ -88,12 +79,6 @@ public class DeserializedPackageMemberScope extends DeserializedMemberScope {
}
}
@NotNull
@Override
protected Collection<ClassDescriptor> computeAllObjectDescriptors() {
return Collections.emptySet();
}
@Override
protected void addNonDeclaredDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
// Do nothing