Delete JetScope.getObjectDescriptors()
This commit is contained in:
-5
@@ -126,11 +126,6 @@ public class DescriptorSerializer {
|
||||
}
|
||||
}
|
||||
|
||||
for (ClassDescriptor descriptor : sort(classDescriptor.getUnsubstitutedInnerClassesScope().getObjectDescriptors())) {
|
||||
int nameIndex = nameTable.getSimpleNameIndex(descriptor.getName());
|
||||
builder.addNestedObjectName(nameIndex);
|
||||
}
|
||||
|
||||
ClassDescriptor classObject = classDescriptor.getClassObjectDescriptor();
|
||||
if (classObject != null) {
|
||||
builder.setClassObject(classObjectProto(classObject));
|
||||
|
||||
-6
@@ -179,12 +179,6 @@ public abstract class DeserializedMemberScope implements JetScope {
|
||||
@NotNull
|
||||
protected abstract Collection<ClassDescriptor> computeAllObjectDescriptors();
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<ClassDescriptor> getObjectDescriptors() {
|
||||
return objectDescriptors.invoke();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public NamespaceDescriptor getNamespace(@NotNull Name name) {
|
||||
|
||||
+29
-23
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.descriptors.serialization.descriptors;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -10,8 +26,8 @@ import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.storage.StorageManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class DeserializedPackageMemberScope extends DeserializedMemberScope {
|
||||
private final DescriptorFinder descriptorFinder;
|
||||
@@ -47,45 +63,35 @@ public class DeserializedPackageMemberScope extends DeserializedMemberScope {
|
||||
@Nullable
|
||||
@Override
|
||||
protected ClassifierDescriptor getClassDescriptor(@NotNull Name name) {
|
||||
return findClassDescriptor(name, false);
|
||||
return findClassDescriptor(name);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ClassDescriptor getObjectDescriptor(@NotNull Name name) {
|
||||
return findClassDescriptor(name, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ClassDescriptor findClassDescriptor(Name name, boolean object) {
|
||||
ClassDescriptor classDescriptor = descriptorFinder.findClass(new ClassId(packageFqName, FqNameUnsafe.topLevel(name)));
|
||||
if (classDescriptor == null) {
|
||||
return null;
|
||||
}
|
||||
return classDescriptor.getKind().isSingleton() == object ? classDescriptor : null;
|
||||
private ClassDescriptor findClassDescriptor(Name name) {
|
||||
return descriptorFinder.findClass(new ClassId(packageFqName, FqNameUnsafe.topLevel(name)));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addAllClassDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
|
||||
findClassifiers(result, false);
|
||||
for (Name className : descriptorFinder.getClassNames(packageFqName)) {
|
||||
ClassDescriptor classDescriptor = findClassDescriptor(className);
|
||||
|
||||
if (classDescriptor != null) {
|
||||
result.add(classDescriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<ClassDescriptor> computeAllObjectDescriptors() {
|
||||
return findClassifiers(new ArrayList<ClassDescriptor>(), true);
|
||||
}
|
||||
|
||||
private <T extends Collection<? super ClassDescriptor>> T findClassifiers(T result, boolean object) {
|
||||
for (Name className : descriptorFinder.getClassNames(packageFqName)) {
|
||||
ClassDescriptor classDescriptor = findClassDescriptor(className, object);
|
||||
|
||||
if (classDescriptor != null) {
|
||||
assert classDescriptor.getKind().isSingleton() == object;
|
||||
result.add(classDescriptor);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user