Delete JetScope.getObjectDescriptors()

This commit is contained in:
Alexander Udalov
2013-11-15 20:51:43 +04:00
parent 31c84951dc
commit 550df37056
20 changed files with 30 additions and 145 deletions
@@ -127,12 +127,6 @@ public abstract class JavaBaseScope extends JetScopeImpl {
return result;
}
@NotNull
@Override
public Set<ClassDescriptor> getObjectDescriptors() {
return Collections.emptySet();
}
@NotNull
protected abstract Collection<ClassDescriptor> computeInnerClasses();
@@ -60,12 +60,6 @@ public abstract class AbstractScopeAdapter implements JetScope {
return getWorkerScope().getObjectDescriptor(name);
}
@NotNull
@Override
public Collection<ClassDescriptor> getObjectDescriptors() {
return getWorkerScope().getObjectDescriptors();
}
@NotNull
@Override
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
@@ -66,16 +66,6 @@ public class ChainedScope implements JetScope {
return null;
}
@NotNull
@Override
public Set<ClassDescriptor> getObjectDescriptors() {
Set<ClassDescriptor> objectDescriptors = Sets.newHashSet();
for (JetScope scope : scopeChain) {
objectDescriptors.addAll(scope.getObjectDescriptors());
}
return objectDescriptors;
}
@Override
public NamespaceDescriptor getNamespace(@NotNull Name name) {
for (JetScope jetScope : scopeChain) {
@@ -70,12 +70,6 @@ public class FilteringScope implements JetScope {
return filterDescriptor(workerScope.getObjectDescriptor(name));
}
@NotNull
@Override
public Collection<ClassDescriptor> getObjectDescriptors() {
return Collections2.filter(workerScope.getObjectDescriptors(), predicate);
}
@NotNull
@Override
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
@@ -56,10 +56,6 @@ public interface JetScope {
@Nullable
ClassDescriptor getObjectDescriptor(@NotNull Name name);
@NotNull
@ReadOnly
Collection<ClassDescriptor> getObjectDescriptors();
@Nullable
NamespaceDescriptor getNamespace(@NotNull Name name);
@@ -26,7 +26,6 @@ import org.jetbrains.jet.utils.Printer;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
public abstract class JetScopeImpl implements JetScope {
@Override
@@ -39,12 +38,6 @@ public abstract class JetScopeImpl implements JetScope {
return null;
}
@NotNull
@Override
public Set<ClassDescriptor> getObjectDescriptors() {
return Collections.emptySet();
}
@NotNull
@Override
public Collection<VariableDescriptor> getProperties(@NotNull Name name) {
@@ -95,4 +88,4 @@ public abstract class JetScopeImpl implements JetScope {
@TestOnly
@Override
public abstract void printScopeStructure(@NotNull Printer p);
}
}
@@ -103,12 +103,6 @@ public class SubstitutingScope implements JetScope {
return substitute(workerScope.getObjectDescriptor(name));
}
@NotNull
@Override
public Collection<ClassDescriptor> getObjectDescriptors() {
return substitute(workerScope.getObjectDescriptors());
}
@NotNull
@Override
public Collection<FunctionDescriptor> getFunctions(@NotNull Name name) {
@@ -395,19 +395,6 @@ public class WritableScopeImpl extends WritableScopeWithImports {
return super.getObjectDescriptor(name);
}
@NotNull
@Override
public Set<ClassDescriptor> getObjectDescriptors() {
if (allObjectDescriptors == null) {
allObjectDescriptors = Sets.newHashSet(getObjectDescriptorsMap().values());
allObjectDescriptors.addAll(getWorkerScope().getObjectDescriptors());
for (JetScope imported : getImports()) {
allObjectDescriptors.addAll(imported.getObjectDescriptors());
}
}
return allObjectDescriptors;
}
@Override
public void addNamespace(@NotNull NamespaceDescriptor namespaceDescriptor) {
checkMayWrite();
@@ -93,12 +93,6 @@ public class ErrorUtils {
return ERROR_CLASS;
}
@NotNull
@Override
public Set<ClassDescriptor> getObjectDescriptors() {
return Collections.emptySet();
}
@NotNull
@Override
public Set<VariableDescriptor> getProperties(@NotNull Name name) {
@@ -181,12 +175,6 @@ public class ErrorUtils {
throw new IllegalStateException();
}
@NotNull
@Override
public Collection<ClassDescriptor> getObjectDescriptors() {
throw new IllegalStateException();
}
@Nullable
@Override
public NamespaceDescriptor getNamespace(@NotNull Name name) {