DescriptorFinder now can find class names in a package
This helps to get rid of "repeated class_name" field in Package protobuf message. DescriptorFinder in resolve.java uses PSI to find all classes in a package, and the finder for built-ins just reads .kotlin_class_names file
This commit is contained in:
@@ -150,19 +150,14 @@ public class NamespaceCodegen extends MemberCodegen {
|
||||
ProtoBuf.Callable proto = serializer.callableProto((CallableMemberDescriptor) descriptor).build();
|
||||
packageProto.addMember(proto);
|
||||
}
|
||||
else if (declaration instanceof JetClassOrObject) {
|
||||
DeclarationDescriptor descriptor = getNotNull(state.getBindingContext(), DECLARATION_TO_DESCRIPTOR, declaration);
|
||||
if (declaration instanceof JetObjectDeclaration) {
|
||||
writeAnnotation = true;
|
||||
JetObjectDeclarationName nameAsDeclaration = ((JetObjectDeclaration) declaration).getNameAsDeclaration();
|
||||
assert nameAsDeclaration != null : "Should be a named object";
|
||||
PropertyDescriptor propertyForObject = getNotNull(state.getBindingContext(), BindingContext.OBJECT_DECLARATION,
|
||||
nameAsDeclaration);
|
||||
ProtoBuf.Callable proto = serializer.callableProto(propertyForObject).build();
|
||||
packageProto.addMember(proto);
|
||||
}
|
||||
int name = serializer.getNameTable().getSimpleNameIndex(descriptor.getName());
|
||||
packageProto.addClassName(name);
|
||||
else if (declaration instanceof JetObjectDeclaration) {
|
||||
writeAnnotation = true;
|
||||
JetObjectDeclarationName nameAsDeclaration = ((JetObjectDeclaration) declaration).getNameAsDeclaration();
|
||||
assert nameAsDeclaration != null : "Should be a named object";
|
||||
PropertyDescriptor propertyForObject = getNotNull(state.getBindingContext(), BindingContext.OBJECT_DECLARATION,
|
||||
nameAsDeclaration);
|
||||
ProtoBuf.Callable proto = serializer.callableProto(propertyForObject).build();
|
||||
packageProto.addMember(proto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -35,6 +35,7 @@ import org.jetbrains.jet.lang.resolve.java.AbiVersionUtil;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.storage.LockBasedStorageManager;
|
||||
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.utils.ExceptionUtils;
|
||||
|
||||
@@ -42,6 +43,7 @@ import javax.inject.Inject;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.asm4.ClassReader.*;
|
||||
@@ -75,6 +77,12 @@ public final class DeserializedDescriptorResolver {
|
||||
public NamespaceDescriptor findPackage(@NotNull FqName name) {
|
||||
return javaNamespaceResolver.resolveNamespace(name);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Name> getClassNames(@NotNull FqName packageName) {
|
||||
return javaNamespaceResolver.getClassNamesInPackage(packageName);
|
||||
}
|
||||
};
|
||||
|
||||
@Inject
|
||||
|
||||
+18
-3
@@ -39,12 +39,11 @@ import org.jetbrains.jet.lang.resolve.java.scope.JavaClassStaticMembersScope;
|
||||
import org.jetbrains.jet.lang.resolve.java.scope.JavaPackageScopeWithoutMembers;
|
||||
import org.jetbrains.jet.lang.resolve.java.wrapper.PsiClassWrapper;
|
||||
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 javax.inject.Inject;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.java.AbiVersionUtil.INVALID_VERSION;
|
||||
|
||||
@@ -273,4 +272,20 @@ public final class JavaNamespaceResolver {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Collection<Name> getClassNamesInPackage(@NotNull FqName packageName) {
|
||||
PsiPackage psiPackage = psiClassFinder.findPsiPackage(packageName);
|
||||
if (psiPackage == null) return Collections.emptyList();
|
||||
|
||||
PsiClass[] classes = psiPackage.getClasses();
|
||||
List<Name> result = new ArrayList<Name>(classes.length);
|
||||
for (PsiClass psiClass : classes) {
|
||||
if (DescriptorResolverUtils.isKotlinClass(psiClass)) {
|
||||
result.add(Name.identifier(psiClass.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -130,8 +130,6 @@ message Class {
|
||||
|
||||
message Package {
|
||||
repeated Callable member = 1;
|
||||
|
||||
repeated int32 class_name = 2;
|
||||
}
|
||||
|
||||
message Callable {
|
||||
@@ -214,4 +212,4 @@ enum Visibility {
|
||||
PROTECTED = 0x02;
|
||||
PUBLIC = 0x03;
|
||||
EXTRA = 0x04; // there's an extra field for the actual visibility
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -21,6 +21,10 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public interface DescriptorFinder {
|
||||
DescriptorFinder EMPTY = new DescriptorFinder() {
|
||||
@@ -35,6 +39,12 @@ public interface DescriptorFinder {
|
||||
public NamespaceDescriptor findPackage(@NotNull FqName name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Name> getClassNames(@NotNull FqName packageName) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
};
|
||||
|
||||
@Nullable
|
||||
@@ -42,4 +52,7 @@ public interface DescriptorFinder {
|
||||
|
||||
@Nullable
|
||||
NamespaceDescriptor findPackage(@NotNull FqName name);
|
||||
|
||||
@NotNull
|
||||
Collection<Name> getClassNames(@NotNull FqName packageName);
|
||||
}
|
||||
|
||||
-108
@@ -4780,11 +4780,6 @@ public final class ProtoBuf {
|
||||
getMemberList();
|
||||
org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable getMember(int index);
|
||||
int getMemberCount();
|
||||
|
||||
// repeated int32 class_name = 2;
|
||||
java.util.List<java.lang.Integer> getClassNameList();
|
||||
int getClassNameCount();
|
||||
int getClassName(int index);
|
||||
}
|
||||
public static final class Package extends
|
||||
com.google.protobuf.GeneratedMessageLite
|
||||
@@ -4825,23 +4820,8 @@ public final class ProtoBuf {
|
||||
return member_.get(index);
|
||||
}
|
||||
|
||||
// repeated int32 class_name = 2;
|
||||
public static final int CLASS_NAME_FIELD_NUMBER = 2;
|
||||
private java.util.List<java.lang.Integer> className_;
|
||||
public java.util.List<java.lang.Integer>
|
||||
getClassNameList() {
|
||||
return className_;
|
||||
}
|
||||
public int getClassNameCount() {
|
||||
return className_.size();
|
||||
}
|
||||
public int getClassName(int index) {
|
||||
return className_.get(index);
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
member_ = java.util.Collections.emptyList();
|
||||
className_ = java.util.Collections.emptyList();;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
@@ -4864,9 +4844,6 @@ public final class ProtoBuf {
|
||||
for (int i = 0; i < member_.size(); i++) {
|
||||
output.writeMessage(1, member_.get(i));
|
||||
}
|
||||
for (int i = 0; i < className_.size(); i++) {
|
||||
output.writeInt32(2, className_.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
@@ -4879,15 +4856,6 @@ public final class ProtoBuf {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, member_.get(i));
|
||||
}
|
||||
{
|
||||
int dataSize = 0;
|
||||
for (int i = 0; i < className_.size(); i++) {
|
||||
dataSize += com.google.protobuf.CodedOutputStream
|
||||
.computeInt32SizeNoTag(className_.get(i));
|
||||
}
|
||||
size += dataSize;
|
||||
size += 1 * getClassNameList().size();
|
||||
}
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
@@ -4992,8 +4960,6 @@ public final class ProtoBuf {
|
||||
super.clear();
|
||||
member_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
className_ = java.util.Collections.emptyList();;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -5031,11 +4997,6 @@ public final class ProtoBuf {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
}
|
||||
result.member_ = member_;
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
className_ = java.util.Collections.unmodifiableList(className_);
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
}
|
||||
result.className_ = className_;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5050,16 +5011,6 @@ public final class ProtoBuf {
|
||||
member_.addAll(other.member_);
|
||||
}
|
||||
|
||||
}
|
||||
if (!other.className_.isEmpty()) {
|
||||
if (className_.isEmpty()) {
|
||||
className_ = other.className_;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
} else {
|
||||
ensureClassNameIsMutable();
|
||||
className_.addAll(other.className_);
|
||||
}
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -5097,20 +5048,6 @@ public final class ProtoBuf {
|
||||
addMember(subBuilder.buildPartial());
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
ensureClassNameIsMutable();
|
||||
className_.add(input.readInt32());
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
int length = input.readRawVarint32();
|
||||
int limit = input.pushLimit(length);
|
||||
while (input.getBytesUntilLimit() > 0) {
|
||||
addClassName(input.readInt32());
|
||||
}
|
||||
input.popLimit(limit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5206,51 +5143,6 @@ public final class ProtoBuf {
|
||||
return this;
|
||||
}
|
||||
|
||||
// repeated int32 class_name = 2;
|
||||
private java.util.List<java.lang.Integer> className_ = java.util.Collections.emptyList();;
|
||||
private void ensureClassNameIsMutable() {
|
||||
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
className_ = new java.util.ArrayList<java.lang.Integer>(className_);
|
||||
bitField0_ |= 0x00000002;
|
||||
}
|
||||
}
|
||||
public java.util.List<java.lang.Integer>
|
||||
getClassNameList() {
|
||||
return java.util.Collections.unmodifiableList(className_);
|
||||
}
|
||||
public int getClassNameCount() {
|
||||
return className_.size();
|
||||
}
|
||||
public int getClassName(int index) {
|
||||
return className_.get(index);
|
||||
}
|
||||
public Builder setClassName(
|
||||
int index, int value) {
|
||||
ensureClassNameIsMutable();
|
||||
className_.set(index, value);
|
||||
|
||||
return this;
|
||||
}
|
||||
public Builder addClassName(int value) {
|
||||
ensureClassNameIsMutable();
|
||||
className_.add(value);
|
||||
|
||||
return this;
|
||||
}
|
||||
public Builder addAllClassName(
|
||||
java.lang.Iterable<? extends java.lang.Integer> values) {
|
||||
ensureClassNameIsMutable();
|
||||
super.addAll(values, className_);
|
||||
|
||||
return this;
|
||||
}
|
||||
public Builder clearClassName() {
|
||||
className_ = java.util.Collections.emptyList();;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Package)
|
||||
}
|
||||
|
||||
|
||||
+3
-18
@@ -20,14 +20,13 @@ public abstract class DeserializedPackageMemberScope extends DeserializedMemberS
|
||||
@NotNull
|
||||
public static DeserializedPackageMemberScope createScopeFromPackageData(
|
||||
@NotNull NamespaceDescriptor packageDescriptor,
|
||||
@NotNull final PackageData packageData,
|
||||
@NotNull PackageData packageData,
|
||||
@NotNull DescriptorFinder descriptorFinder,
|
||||
@NotNull AnnotationDeserializer deserializer,
|
||||
@NotNull LockBasedStorageManager storageManager
|
||||
) {
|
||||
final NameResolver nameResolver = packageData.getNameResolver();
|
||||
DescriptorDeserializer descriptorDeserializer = DescriptorDeserializer
|
||||
.create(storageManager, packageDescriptor, nameResolver, descriptorFinder, deserializer);
|
||||
.create(storageManager, packageDescriptor, packageData.getNameResolver(), descriptorFinder, deserializer);
|
||||
List<ProtoBuf.Callable> memberList = packageData.getPackageProto().getMemberList();
|
||||
return new DeserializedPackageMemberScope(storageManager, packageDescriptor, descriptorDeserializer, memberList, descriptorFinder) {
|
||||
@Nullable
|
||||
@@ -35,17 +34,6 @@ public abstract class DeserializedPackageMemberScope extends DeserializedMemberS
|
||||
protected ReceiverParameterDescriptor getImplicitReceiver() {
|
||||
return ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<Name> getClassNames() {
|
||||
Collection<Integer> nameIds = packageData.getPackageProto().getClassNameList();
|
||||
List<Name> result = new ArrayList<Name>(nameIds.size());
|
||||
for (Integer nameId : nameIds) {
|
||||
result.add(nameResolver.getName(nameId));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -98,7 +86,7 @@ public abstract class DeserializedPackageMemberScope extends DeserializedMemberS
|
||||
}
|
||||
|
||||
private <T extends Collection<? super ClassDescriptor>> T findClassifiers(T result, boolean object) {
|
||||
for (Name className : getClassNames()) {
|
||||
for (Name className : descriptorFinder.getClassNames(packageFqName)) {
|
||||
ClassDescriptor classDescriptor = findClassDescriptor(className, object);
|
||||
|
||||
if (classDescriptor != null) {
|
||||
@@ -109,9 +97,6 @@ public abstract class DeserializedPackageMemberScope extends DeserializedMemberS
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected abstract Collection<Name> getClassNames();
|
||||
|
||||
@Override
|
||||
protected void addNonDeclaredDescriptors(@NotNull Collection<DeclarationDescriptor> result) {
|
||||
// Do nothing
|
||||
|
||||
+35
-32
@@ -37,8 +37,33 @@ class BuiltinsNamespaceDescriptorImpl extends AbstractNamespaceDescriptorImpl {
|
||||
try {
|
||||
nameResolver = NameSerializationUtil.deserializeNameResolver(getStream(BuiltInsSerializationUtil.getNameTableFilePath(this)));
|
||||
|
||||
DescriptorFinder descriptorFinder = new AbstractDescriptorFinder(storageManager, AnnotationDeserializer.UNSUPPORTED) {
|
||||
final NotNullLazyValue<Collection<Name>> classNames = storageManager.createLazyValue(new Computable<Collection<Name>>() {
|
||||
@Override
|
||||
@NotNull
|
||||
public Collection<Name> compute() {
|
||||
InputStream in = getStream(BuiltInsSerializationUtil.getClassNamesFilePath(BuiltinsNamespaceDescriptorImpl.this));
|
||||
|
||||
try {
|
||||
DataInputStream data = new DataInputStream(in);
|
||||
try {
|
||||
int size = data.readInt();
|
||||
List<Name> result = new ArrayList<Name>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
result.add(nameResolver.getName(data.readInt()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
finally {
|
||||
data.close();
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
DescriptorFinder descriptorFinder = new AbstractDescriptorFinder(storageManager, AnnotationDeserializer.UNSUPPORTED) {
|
||||
@Nullable
|
||||
@Override
|
||||
protected ClassData getClassData(@NotNull ClassId classId) {
|
||||
@@ -71,48 +96,26 @@ class BuiltinsNamespaceDescriptorImpl extends AbstractNamespaceDescriptorImpl {
|
||||
return fqName.equals(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME) ? BuiltinsNamespaceDescriptorImpl.this : null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Name> getClassNames(@NotNull FqName packageName) {
|
||||
return packageName.equals(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME)
|
||||
? classNames.compute()
|
||||
: Collections.<Name>emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void classDescriptorCreated(@NotNull ClassDescriptor classDescriptor) {
|
||||
// Do nothing
|
||||
}
|
||||
};
|
||||
|
||||
members = new DeserializedPackageMemberScope(
|
||||
storageManager,
|
||||
this,
|
||||
DescriptorDeserializer.create(storageManager, this, nameResolver, descriptorFinder, AnnotationDeserializer.UNSUPPORTED),
|
||||
loadCallables(), descriptorFinder
|
||||
) {
|
||||
private final NotNullLazyValue<Collection<Name>> classNames = storageManager.createLazyValue(new Computable<Collection<Name>>() {
|
||||
@Override
|
||||
public Collection<Name> compute() {
|
||||
InputStream in = getStream(BuiltInsSerializationUtil.getClassNamesFilePath(BuiltinsNamespaceDescriptorImpl.this));
|
||||
|
||||
try {
|
||||
DataInputStream data = new DataInputStream(in);
|
||||
try {
|
||||
int size = data.readInt();
|
||||
List<Name> result = new ArrayList<Name>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
result.add(nameResolver.getName(data.readInt()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
finally {
|
||||
data.close();
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<Name> getClassNames() {
|
||||
return classNames.compute();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected ReceiverParameterDescriptor getImplicitReceiver() {
|
||||
|
||||
@@ -32,8 +32,10 @@ import org.jetbrains.jet.lang.descriptors.impl.NamespaceDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.storage.LockBasedStorageManager;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
public class KotlinClassAnnotationTest extends CodegenTestCase {
|
||||
public static final FqName NAMESPACE_NAME = new FqName("test");
|
||||
@@ -90,6 +92,12 @@ public class KotlinClassAnnotationTest extends CodegenTestCase {
|
||||
return namespace;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Name> getClassNames(@NotNull FqName packageName) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void classDescriptorCreated(@NotNull ClassDescriptor classDescriptor) {
|
||||
}
|
||||
|
||||
@@ -55,9 +55,6 @@ public class KotlinPackageAnnotationTest extends CodegenTestCase {
|
||||
|
||||
PackageData data = JavaProtoBufUtil.readPackageDataFrom(kotlinPackage.data());
|
||||
|
||||
Set<String> classNames = collectClassNames(data);
|
||||
assertSameElements(Arrays.asList("A", "B", "C"), classNames);
|
||||
|
||||
Set<String> callableNames = collectCallableNames(data);
|
||||
assertSameElements(Arrays.asList("foo", "bar", "C"), callableNames);
|
||||
}
|
||||
@@ -71,13 +68,4 @@ public class KotlinPackageAnnotationTest extends CodegenTestCase {
|
||||
}
|
||||
return callableNames;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Set<String> collectClassNames(@NotNull PackageData data) {
|
||||
Set<String> classNames = new HashSet<String>();
|
||||
for (int name : data.getPackageProto().getClassNameList()) {
|
||||
classNames.add(data.getNameResolver().getName(name).asString());
|
||||
}
|
||||
return classNames;
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -295,6 +295,12 @@ public abstract class AbstractDescriptorSerializationTest extends KotlinTestWith
|
||||
public NamespaceDescriptor findPackage(@NotNull FqName name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Name> getClassNames(@NotNull FqName packageName) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
private static class JavaDescriptorFinder implements DescriptorFinder {
|
||||
@@ -340,5 +346,11 @@ public abstract class AbstractDescriptorSerializationTest extends KotlinTestWith
|
||||
public NamespaceDescriptor findPackage(@NotNull FqName name) {
|
||||
return javaDescriptorResolver.resolveNamespace(name);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Name> getClassNames(@NotNull FqName packageName) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-2
@@ -32,6 +32,7 @@ import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.KotlinTestWithEnvironment;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.storage.LockBasedStorageManager;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.renderer.DescriptorRenderer;
|
||||
@@ -75,8 +76,7 @@ public class BuiltinsDeserializationTest extends KotlinTestWithEnvironment {
|
||||
|
||||
List<ProtoBuf.Callable> callableProtos = serializeCallables(serializer, allDescriptors);
|
||||
|
||||
final NamespaceDescriptorImpl actualNamespace = JetTestUtils
|
||||
.createTestNamespace(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME.shortName());
|
||||
final NamespaceDescriptorImpl actualNamespace = JetTestUtils.createTestNamespace(KotlinBuiltIns.BUILT_INS_PACKAGE_NAME);
|
||||
|
||||
final NameResolver nameResolver = NameSerializationUtil.createNameResolver(serializer.getNameTable());
|
||||
|
||||
@@ -88,6 +88,12 @@ public class BuiltinsDeserializationTest extends KotlinTestWithEnvironment {
|
||||
return actualNamespace;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Name> getClassNames(@NotNull FqName packageName) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected ClassData getClassData(@NotNull ClassId classId) {
|
||||
|
||||
Reference in New Issue
Block a user