Stub support for annotations
This commit is contained in:
committed by
Alexander Udalov
parent
557fdfcd56
commit
4f12a3d86e
@@ -101,14 +101,13 @@ message Class {
|
|||||||
/*
|
/*
|
||||||
Visibility
|
Visibility
|
||||||
Modality
|
Modality
|
||||||
|
has_annotation
|
||||||
ClassKind
|
ClassKind
|
||||||
is_inner
|
is_inner
|
||||||
*/
|
*/
|
||||||
optional int32 flags = 1 [default = 0 /*internal final class*/];
|
optional int32 flags = 1 [default = 0 /*internal final class, no annotations*/];
|
||||||
optional string extra_visibility = 2; // for things like java-specific visibilities
|
optional string extra_visibility = 2; // for things like java-specific visibilities
|
||||||
|
|
||||||
repeated Annotation annotations = 3;
|
|
||||||
|
|
||||||
required int32 name = 4;
|
required int32 name = 4;
|
||||||
|
|
||||||
repeated TypeParameter typeParameters = 5;
|
repeated TypeParameter typeParameters = 5;
|
||||||
@@ -147,17 +146,17 @@ message Callable {
|
|||||||
/*
|
/*
|
||||||
Visibility
|
Visibility
|
||||||
Modality
|
Modality
|
||||||
|
has_annotations
|
||||||
fun/val/var/constructor
|
fun/val/var/constructor
|
||||||
Kind
|
Kind
|
||||||
inline
|
inline
|
||||||
setter::Modality
|
setter::Modality
|
||||||
setter::Visibility
|
setter::Visibility
|
||||||
|
setter::has_annotations
|
||||||
*/
|
*/
|
||||||
optional int32 flags = 1;
|
optional int32 flags = 1;
|
||||||
optional string extra_visibility = 2; // for things like java-specific visibilities
|
optional string extra_visibility = 2; // for things like java-specific visibilities
|
||||||
|
|
||||||
repeated Annotation annotations = 3;
|
|
||||||
|
|
||||||
repeated TypeParameter typeParameters = 4;
|
repeated TypeParameter typeParameters = 4;
|
||||||
|
|
||||||
optional Type receiverType = 5;
|
optional Type receiverType = 5;
|
||||||
@@ -167,6 +166,7 @@ message Callable {
|
|||||||
message ValueParameter {
|
message ValueParameter {
|
||||||
/*
|
/*
|
||||||
declaresDefault
|
declaresDefault
|
||||||
|
has_annotations
|
||||||
*/
|
*/
|
||||||
optional int32 flags = 1;
|
optional int32 flags = 1;
|
||||||
required int32 name = 2;
|
required int32 name = 2;
|
||||||
@@ -194,8 +194,4 @@ enum Visibility {
|
|||||||
PROTECTED = 0x02;
|
PROTECTED = 0x02;
|
||||||
PUBLIC = 0x03;
|
PUBLIC = 0x03;
|
||||||
EXTRA = 0x04; // there's an extra field for the actual visibility
|
EXTRA = 0x04; // there's an extra field for the actual visibility
|
||||||
}
|
|
||||||
|
|
||||||
message Annotation {
|
|
||||||
// TODO ???
|
|
||||||
}
|
}
|
||||||
+8
-2
@@ -18,6 +18,7 @@ package org.jetbrains.jet.descriptors.serialization;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationDeserializer;
|
||||||
import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedClassDescriptor;
|
import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedClassDescriptor;
|
||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||||
@@ -31,9 +32,11 @@ public abstract class AbstractClassResolver implements ClassResolver {
|
|||||||
private final NameResolver nameResolver;
|
private final NameResolver nameResolver;
|
||||||
private final NestedClassResolver nestedClassResolver;
|
private final NestedClassResolver nestedClassResolver;
|
||||||
private final MemoizedFunctionToNotNull<ClassId, ClassDescriptor> findClass;
|
private final MemoizedFunctionToNotNull<ClassId, ClassDescriptor> findClass;
|
||||||
|
private final AnnotationDeserializer annotationDeserializer;
|
||||||
|
|
||||||
public AbstractClassResolver(@NotNull NameResolver nameResolver) {
|
public AbstractClassResolver(@NotNull NameResolver nameResolver, @NotNull AnnotationDeserializer annotationDeserializer) {
|
||||||
this.nameResolver = nameResolver;
|
this.nameResolver = nameResolver;
|
||||||
|
this.annotationDeserializer = annotationDeserializer;
|
||||||
|
|
||||||
this.nestedClassResolver = new NestedClassResolver() {
|
this.nestedClassResolver = new NestedClassResolver() {
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -55,11 +58,14 @@ public abstract class AbstractClassResolver implements ClassResolver {
|
|||||||
protected ClassDescriptor doCompute(ClassId classId) {
|
protected ClassDescriptor doCompute(ClassId classId) {
|
||||||
ProtoBuf.Class classProto = getClassProto(classId);
|
ProtoBuf.Class classProto = getClassProto(classId);
|
||||||
assert classProto != null : "No class found: " + classId;
|
assert classProto != null : "No class found: " + classId;
|
||||||
|
|
||||||
DeclarationDescriptor owner =
|
DeclarationDescriptor owner =
|
||||||
classId.isTopLevelClass() ? getPackage(classId.getPackageFqName()) : findClass(classId.getOuterClassId());
|
classId.isTopLevelClass() ? getPackage(classId.getPackageFqName()) : findClass(classId.getOuterClassId());
|
||||||
assert owner != null : "No owner found for " + classId;
|
assert owner != null : "No owner found for " + classId;
|
||||||
|
|
||||||
|
AbstractClassResolver outer = AbstractClassResolver.this;
|
||||||
ClassDescriptor classDescriptor = new DeserializedClassDescriptor(
|
ClassDescriptor classDescriptor = new DeserializedClassDescriptor(
|
||||||
owner, AbstractClassResolver.this.nameResolver, AbstractClassResolver.this, nestedClassResolver, classProto, null
|
owner, outer.nameResolver, outer.annotationDeserializer, outer, nestedClassResolver, classProto, null
|
||||||
);
|
);
|
||||||
classDescriptorCreated(classDescriptor);
|
classDescriptorCreated(classDescriptor);
|
||||||
return classDescriptor;
|
return classDescriptor;
|
||||||
|
|||||||
+30
-15
@@ -17,6 +17,7 @@
|
|||||||
package org.jetbrains.jet.descriptors.serialization;
|
package org.jetbrains.jet.descriptors.serialization;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationDeserializer;
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.*;
|
||||||
import org.jetbrains.jet.lang.descriptors.Modality;
|
import org.jetbrains.jet.lang.descriptors.Modality;
|
||||||
import org.jetbrains.jet.lang.descriptors.Visibility;
|
import org.jetbrains.jet.lang.descriptors.Visibility;
|
||||||
@@ -36,32 +37,38 @@ public class DescriptorDeserializer {
|
|||||||
public static DescriptorDeserializer create(
|
public static DescriptorDeserializer create(
|
||||||
@NotNull DeclarationDescriptor containingDeclaration,
|
@NotNull DeclarationDescriptor containingDeclaration,
|
||||||
@NotNull NameResolver nameResolver,
|
@NotNull NameResolver nameResolver,
|
||||||
@NotNull ClassResolver classResolver
|
@NotNull ClassResolver classResolver,
|
||||||
|
@NotNull AnnotationDeserializer annotationDeserializer
|
||||||
) {
|
) {
|
||||||
return new DescriptorDeserializer(new TypeDeserializer(null, nameResolver, classResolver), containingDeclaration, nameResolver);
|
return new DescriptorDeserializer(new TypeDeserializer(null, nameResolver, classResolver), containingDeclaration, nameResolver,
|
||||||
|
annotationDeserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static DescriptorDeserializer create(
|
public static DescriptorDeserializer create(
|
||||||
@NotNull TypeDeserializer typeDeserializer,
|
@NotNull TypeDeserializer typeDeserializer,
|
||||||
@NotNull DeclarationDescriptor containingDeclaration,
|
@NotNull DeclarationDescriptor containingDeclaration,
|
||||||
@NotNull NameResolver nameResolver
|
@NotNull NameResolver nameResolver,
|
||||||
|
@NotNull AnnotationDeserializer annotationDeserializer
|
||||||
) {
|
) {
|
||||||
return new DescriptorDeserializer(typeDeserializer, containingDeclaration, nameResolver);
|
return new DescriptorDeserializer(typeDeserializer, containingDeclaration, nameResolver, annotationDeserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final DeclarationDescriptor containingDeclaration;
|
private final DeclarationDescriptor containingDeclaration;
|
||||||
private final NameResolver nameResolver;
|
private final NameResolver nameResolver;
|
||||||
private final TypeDeserializer typeDeserializer;
|
private final TypeDeserializer typeDeserializer;
|
||||||
|
private final AnnotationDeserializer annotationDeserializer;
|
||||||
|
|
||||||
private DescriptorDeserializer(
|
private DescriptorDeserializer(
|
||||||
@NotNull TypeDeserializer typeDeserializer,
|
@NotNull TypeDeserializer typeDeserializer,
|
||||||
@NotNull DeclarationDescriptor containingDeclaration,
|
@NotNull DeclarationDescriptor containingDeclaration,
|
||||||
@NotNull NameResolver nameResolver
|
@NotNull NameResolver nameResolver,
|
||||||
|
@NotNull AnnotationDeserializer annotationDeserializer
|
||||||
) {
|
) {
|
||||||
this.typeDeserializer = typeDeserializer;
|
this.typeDeserializer = typeDeserializer;
|
||||||
this.containingDeclaration = containingDeclaration;
|
this.containingDeclaration = containingDeclaration;
|
||||||
this.nameResolver = nameResolver;
|
this.nameResolver = nameResolver;
|
||||||
|
this.annotationDeserializer = annotationDeserializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -71,7 +78,7 @@ public class DescriptorDeserializer {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private DescriptorDeserializer createChildDeserializer(@NotNull DeclarationDescriptor descriptor) {
|
private DescriptorDeserializer createChildDeserializer(@NotNull DeclarationDescriptor descriptor) {
|
||||||
return create(new TypeDeserializer(typeDeserializer), descriptor, nameResolver);
|
return create(new TypeDeserializer(typeDeserializer), descriptor, nameResolver, annotationDeserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -94,8 +101,7 @@ public class DescriptorDeserializer {
|
|||||||
int flags = proto.getFlags();
|
int flags = proto.getFlags();
|
||||||
PropertyDescriptorImpl property = new PropertyDescriptorImpl(
|
PropertyDescriptorImpl property = new PropertyDescriptorImpl(
|
||||||
containingDeclaration,
|
containingDeclaration,
|
||||||
// TODO: annotations
|
getAnnotations(proto),
|
||||||
Collections.<AnnotationDescriptor>emptyList(),
|
|
||||||
modality(Flags.getModality(flags)),
|
modality(Flags.getModality(flags)),
|
||||||
visibility(Flags.getVisibility(flags)),
|
visibility(Flags.getVisibility(flags)),
|
||||||
Flags.getCallableKind(flags) == Callable.CallableKind.VAR,
|
Flags.getCallableKind(flags) == Callable.CallableKind.VAR,
|
||||||
@@ -119,8 +125,7 @@ public class DescriptorDeserializer {
|
|||||||
int flags = proto.getFlags();
|
int flags = proto.getFlags();
|
||||||
SimpleFunctionDescriptorImpl function = new SimpleFunctionDescriptorImpl(
|
SimpleFunctionDescriptorImpl function = new SimpleFunctionDescriptorImpl(
|
||||||
containingDeclaration,
|
containingDeclaration,
|
||||||
// TODO: annotations
|
getAnnotations(proto),
|
||||||
Collections.<AnnotationDescriptor>emptyList(),
|
|
||||||
nameResolver.getName(proto.getName()),
|
nameResolver.getName(proto.getName()),
|
||||||
memberKind(Flags.getMemberKind(flags))
|
memberKind(Flags.getMemberKind(flags))
|
||||||
);
|
);
|
||||||
@@ -146,8 +151,7 @@ public class DescriptorDeserializer {
|
|||||||
ClassDescriptor classDescriptor = (ClassDescriptor) containingDeclaration;
|
ClassDescriptor classDescriptor = (ClassDescriptor) containingDeclaration;
|
||||||
ConstructorDescriptorImpl descriptor = new ConstructorDescriptorImpl(
|
ConstructorDescriptorImpl descriptor = new ConstructorDescriptorImpl(
|
||||||
classDescriptor,
|
classDescriptor,
|
||||||
// TODO
|
getAnnotations(proto),
|
||||||
Collections.<AnnotationDescriptor>emptyList(),
|
|
||||||
// TODO: primary
|
// TODO: primary
|
||||||
true);
|
true);
|
||||||
DescriptorDeserializer local = createChildDeserializer(descriptor);
|
DescriptorDeserializer local = createChildDeserializer(descriptor);
|
||||||
@@ -160,6 +164,12 @@ public class DescriptorDeserializer {
|
|||||||
return descriptor;
|
return descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<AnnotationDescriptor> getAnnotations(Callable proto) {
|
||||||
|
return Flags.hasAnnotations(proto.getFlags())
|
||||||
|
? annotationDeserializer.loadCallableAnnotations(proto)
|
||||||
|
: Collections.<AnnotationDescriptor>emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
private static CallableMemberDescriptor.Kind memberKind(Callable.MemberKind memberKind) {
|
private static CallableMemberDescriptor.Kind memberKind(Callable.MemberKind memberKind) {
|
||||||
switch (memberKind) {
|
switch (memberKind) {
|
||||||
case DECLARATION:
|
case DECLARATION:
|
||||||
@@ -247,7 +257,7 @@ public class DescriptorDeserializer {
|
|||||||
int id = proto.getId();
|
int id = proto.getId();
|
||||||
TypeParameterDescriptorImpl descriptor = TypeParameterDescriptorImpl.createForFurtherModification(
|
TypeParameterDescriptorImpl descriptor = TypeParameterDescriptorImpl.createForFurtherModification(
|
||||||
containingDeclaration,
|
containingDeclaration,
|
||||||
// TODO
|
// TODO (type parameter annotations are not supported in Java 7)
|
||||||
Collections.<AnnotationDescriptor>emptyList(),
|
Collections.<AnnotationDescriptor>emptyList(),
|
||||||
proto.getReified(),
|
proto.getReified(),
|
||||||
variance(proto.getVariance()),
|
variance(proto.getVariance()),
|
||||||
@@ -291,11 +301,16 @@ public class DescriptorDeserializer {
|
|||||||
return new ValueParameterDescriptorImpl(
|
return new ValueParameterDescriptorImpl(
|
||||||
containingDeclaration,
|
containingDeclaration,
|
||||||
index,
|
index,
|
||||||
// TODO
|
getAnnotations(proto),
|
||||||
Collections.<AnnotationDescriptor>emptyList(),
|
|
||||||
nameResolver.getName(proto.getName()),
|
nameResolver.getName(proto.getName()),
|
||||||
typeDeserializer.type(proto.getType()),
|
typeDeserializer.type(proto.getType()),
|
||||||
Flags.declaresDefaultValue(proto.getFlags()),
|
Flags.declaresDefaultValue(proto.getFlags()),
|
||||||
typeDeserializer.typeOrNull(proto.hasVarargElementType() ? proto.getVarargElementType() : null));
|
typeDeserializer.typeOrNull(proto.hasVarargElementType() ? proto.getVarargElementType() : null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<AnnotationDescriptor> getAnnotations(Callable.ValueParameter proto) {
|
||||||
|
return Flags.hasAnnotations(proto.getFlags())
|
||||||
|
? annotationDeserializer.loadValueParameterAnnotations(proto)
|
||||||
|
: Collections.<AnnotationDescriptor>emptyList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-6
@@ -18,6 +18,7 @@ package org.jetbrains.jet.descriptors.serialization;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.*;
|
||||||
|
import org.jetbrains.jet.lang.descriptors.annotations.Annotated;
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
import org.jetbrains.jet.lang.types.TypeConstructor;
|
import org.jetbrains.jet.lang.types.TypeConstructor;
|
||||||
import org.jetbrains.jet.lang.types.TypeProjection;
|
import org.jetbrains.jet.lang.types.TypeProjection;
|
||||||
@@ -52,10 +53,8 @@ public class DescriptorSerializer {
|
|||||||
public ProtoBuf.Class.Builder classProto(@NotNull ClassDescriptor classDescriptor) {
|
public ProtoBuf.Class.Builder classProto(@NotNull ClassDescriptor classDescriptor) {
|
||||||
ProtoBuf.Class.Builder builder = ProtoBuf.Class.newBuilder();
|
ProtoBuf.Class.Builder builder = ProtoBuf.Class.newBuilder();
|
||||||
|
|
||||||
// TODO annotations
|
int flags = Flags.getClassFlags(hasAnnotations(classDescriptor), classDescriptor.getVisibility(),
|
||||||
|
classDescriptor.getModality(), classDescriptor.getKind(), classDescriptor.isInner());
|
||||||
int flags = Flags.getClassFlags(classDescriptor.getVisibility(), classDescriptor.getModality(), classDescriptor.getKind(),
|
|
||||||
classDescriptor.isInner());
|
|
||||||
builder.setFlags(flags);
|
builder.setFlags(flags);
|
||||||
|
|
||||||
// TODO extra visibility
|
// TODO extra visibility
|
||||||
@@ -111,7 +110,8 @@ public class DescriptorSerializer {
|
|||||||
ProtoBuf.Callable.Builder builder = ProtoBuf.Callable.newBuilder();
|
ProtoBuf.Callable.Builder builder = ProtoBuf.Callable.newBuilder();
|
||||||
|
|
||||||
// TODO setter flags
|
// TODO setter flags
|
||||||
builder.setFlags(Flags.getCallableFlags(descriptor.getVisibility(),
|
// TODO setter annotations
|
||||||
|
builder.setFlags(Flags.getCallableFlags(hasAnnotations(descriptor), descriptor.getVisibility(),
|
||||||
descriptor.getModality(),
|
descriptor.getModality(),
|
||||||
descriptor.getKind(),
|
descriptor.getKind(),
|
||||||
callableKind(descriptor),
|
callableKind(descriptor),
|
||||||
@@ -159,7 +159,7 @@ public class DescriptorSerializer {
|
|||||||
private ProtoBuf.Callable.ValueParameter.Builder valueParameter(ValueParameterDescriptor descriptor) {
|
private ProtoBuf.Callable.ValueParameter.Builder valueParameter(ValueParameterDescriptor descriptor) {
|
||||||
ProtoBuf.Callable.ValueParameter.Builder builder = ProtoBuf.Callable.ValueParameter.newBuilder();
|
ProtoBuf.Callable.ValueParameter.Builder builder = ProtoBuf.Callable.ValueParameter.newBuilder();
|
||||||
|
|
||||||
builder.setFlags(Flags.getValueParameterFlags(descriptor.declaresDefaultValue()));
|
builder.setFlags(Flags.getValueParameterFlags(hasAnnotations(descriptor), descriptor.declaresDefaultValue()));
|
||||||
|
|
||||||
builder.setName(nameTable.getSimpleNameIndex(descriptor.getName()));
|
builder.setName(nameTable.getSimpleNameIndex(descriptor.getName()));
|
||||||
|
|
||||||
@@ -283,4 +283,8 @@ public class DescriptorSerializer {
|
|||||||
private int getTypeParameterId(@NotNull TypeParameterDescriptor descriptor) {
|
private int getTypeParameterId(@NotNull TypeParameterDescriptor descriptor) {
|
||||||
return typeParameters.intern(descriptor);
|
return typeParameters.intern(descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean hasAnnotations(Annotated descriptor) {
|
||||||
|
return !descriptor.getAnnotations().isEmpty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-9
@@ -8,8 +8,11 @@ public class Flags {
|
|||||||
|
|
||||||
// Common
|
// Common
|
||||||
|
|
||||||
|
public static final int HAS_ANNOTATIONS_BIT_COUNT = 1;
|
||||||
|
public static final int HAS_ANNOTATIONS_OFFSET = 0;
|
||||||
|
|
||||||
public static final int VISIBILITY_BIT_COUNT = bitWidth(ProtoBuf.Visibility.values());
|
public static final int VISIBILITY_BIT_COUNT = bitWidth(ProtoBuf.Visibility.values());
|
||||||
public static final int VISIBILITY_OFFSET = 0;
|
public static final int VISIBILITY_OFFSET = HAS_ANNOTATIONS_OFFSET + HAS_ANNOTATIONS_BIT_COUNT;
|
||||||
|
|
||||||
public static final int MODALITY_BIT_COUNT = bitWidth(ProtoBuf.Modality.values());
|
public static final int MODALITY_BIT_COUNT = bitWidth(ProtoBuf.Modality.values());
|
||||||
public static final int MODALITY_OFFSET = VISIBILITY_OFFSET + VISIBILITY_BIT_COUNT;
|
public static final int MODALITY_OFFSET = VISIBILITY_OFFSET + VISIBILITY_BIT_COUNT;
|
||||||
@@ -36,7 +39,7 @@ public class Flags {
|
|||||||
// Parameters
|
// Parameters
|
||||||
|
|
||||||
public static final int DECLARES_DEFAULT_VALUE_BIT_COUNT = 1;
|
public static final int DECLARES_DEFAULT_VALUE_BIT_COUNT = 1;
|
||||||
public static final int DECLARES_DEFAULT_VALUE_OFFSET = 0;
|
public static final int DECLARES_DEFAULT_VALUE_OFFSET = HAS_ANNOTATIONS_OFFSET + HAS_ANNOTATIONS_BIT_COUNT;
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
@@ -96,13 +99,25 @@ public class Flags {
|
|||||||
return getValue(flags, BOOLEANS, DECLARES_DEFAULT_VALUE_BIT_COUNT, DECLARES_DEFAULT_VALUE_OFFSET);
|
return getValue(flags, BOOLEANS, DECLARES_DEFAULT_VALUE_BIT_COUNT, DECLARES_DEFAULT_VALUE_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getClassFlags(Visibility visibility, Modality modality, ClassKind kind, boolean inner) {
|
public static boolean hasAnnotations(int flags) {
|
||||||
|
return getValue(flags, BOOLEANS, HAS_ANNOTATIONS_BIT_COUNT, HAS_ANNOTATIONS_OFFSET);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getClassFlags(
|
||||||
|
boolean hasAnnotations,
|
||||||
|
Visibility visibility,
|
||||||
|
Modality modality,
|
||||||
|
ClassKind kind,
|
||||||
|
boolean inner
|
||||||
|
) {
|
||||||
|
int hasAnnotationsInt = hasAnnotations ? 1 : 0;
|
||||||
int visibilityInt = visibility(visibility).getNumber();
|
int visibilityInt = visibility(visibility).getNumber();
|
||||||
int modalityInt = modality(modality).getNumber();
|
int modalityInt = modality(modality).getNumber();
|
||||||
int classKindInt = classKind(kind).getNumber();
|
int classKindInt = classKind(kind).getNumber();
|
||||||
int innerInt = inner ? 1 : 0;
|
int innerInt = inner ? 1 : 0;
|
||||||
return visibilityInt << VISIBILITY_OFFSET
|
return hasAnnotationsInt << HAS_ANNOTATIONS_OFFSET
|
||||||
| modalityInt << MODALITY_OFFSET
|
| modalityInt << MODALITY_OFFSET
|
||||||
|
| visibilityInt << VISIBILITY_OFFSET
|
||||||
| classKindInt << CLASS_KIND_OFFSET
|
| classKindInt << CLASS_KIND_OFFSET
|
||||||
| innerInt << INNER_OFFSET
|
| innerInt << INNER_OFFSET
|
||||||
;
|
;
|
||||||
@@ -129,19 +144,21 @@ public class Flags {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getCallableFlags(
|
public static int getCallableFlags(
|
||||||
@NotNull Visibility visibility,
|
boolean hasAnnotations, @NotNull Visibility visibility,
|
||||||
@NotNull Modality modality,
|
@NotNull Modality modality,
|
||||||
@NotNull CallableMemberDescriptor.Kind memberKind,
|
@NotNull CallableMemberDescriptor.Kind memberKind,
|
||||||
@NotNull ProtoBuf.Callable.CallableKind callableKind,
|
@NotNull ProtoBuf.Callable.CallableKind callableKind,
|
||||||
boolean inline
|
boolean inline
|
||||||
) {
|
) {
|
||||||
|
int hasAnnotationsInt = hasAnnotations ? 1 : 0;
|
||||||
int visibilityInt = visibility(visibility).getNumber();
|
int visibilityInt = visibility(visibility).getNumber();
|
||||||
int modalityInt = modality(modality).getNumber();
|
int modalityInt = modality(modality).getNumber();
|
||||||
int memberKindInt = memberKind(memberKind).getNumber();
|
int memberKindInt = memberKind(memberKind).getNumber();
|
||||||
int callableKindInt = callableKind.getNumber();
|
int callableKindInt = callableKind.getNumber();
|
||||||
int inlineInt = inline ? 1 : 0;
|
int inlineInt = inline ? 1 : 0;
|
||||||
return visibilityInt << VISIBILITY_OFFSET
|
return hasAnnotationsInt << HAS_ANNOTATIONS_OFFSET
|
||||||
| modalityInt << MODALITY_OFFSET
|
| modalityInt << MODALITY_OFFSET
|
||||||
|
| visibilityInt << VISIBILITY_OFFSET
|
||||||
| memberKindInt << MEMBER_KIND_OFFSET
|
| memberKindInt << MEMBER_KIND_OFFSET
|
||||||
| callableKindInt << CALLABLE_KIND_OFFSET
|
| callableKindInt << CALLABLE_KIND_OFFSET
|
||||||
| inlineInt << INLINE_OFFSET
|
| inlineInt << INLINE_OFFSET
|
||||||
@@ -193,9 +210,11 @@ public class Flags {
|
|||||||
throw new IllegalArgumentException("Unknown member kind: " + kind);
|
throw new IllegalArgumentException("Unknown member kind: " + kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getValueParameterFlags(boolean declaresDefaultValue) {
|
public static int getValueParameterFlags(boolean hasAnnotations, boolean declaresDefaultValue) {
|
||||||
|
int hasAnnotationsInt = hasAnnotations ? 1 : 0;
|
||||||
int declaresDefaultValueInt = declaresDefaultValue ? 1 : 0;
|
int declaresDefaultValueInt = declaresDefaultValue ? 1 : 0;
|
||||||
return declaresDefaultValueInt << DECLARES_DEFAULT_VALUE_OFFSET
|
return hasAnnotationsInt << HAS_ANNOTATIONS_OFFSET
|
||||||
;
|
| declaresDefaultValueInt << DECLARES_DEFAULT_VALUE_OFFSET
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+90
-605
File diff suppressed because it is too large
Load Diff
+48
@@ -0,0 +1,48 @@
|
|||||||
|
package org.jetbrains.jet.descriptors.serialization.descriptors;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.descriptors.serialization.ProtoBuf;
|
||||||
|
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AnnotationDeserializer {
|
||||||
|
AnnotationDeserializer UNSUPPORTED = new AnnotationDeserializer() {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<AnnotationDescriptor> loadClassAnnotations(
|
||||||
|
@NotNull ProtoBuf.Class classProto
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException("Annotations are not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<AnnotationDescriptor> loadCallableAnnotations(
|
||||||
|
@NotNull ProtoBuf.Callable callableProto
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException("Annotations are not supported");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<AnnotationDescriptor> loadValueParameterAnnotations(
|
||||||
|
@NotNull ProtoBuf.Callable.ValueParameter parameterProto
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException("Annotations are not supported");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
List<AnnotationDescriptor> loadClassAnnotations(@NotNull ProtoBuf.Class classProto);
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
List<AnnotationDescriptor> loadCallableAnnotations(
|
||||||
|
@NotNull ProtoBuf.Callable callableProto
|
||||||
|
);
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
List<AnnotationDescriptor> loadValueParameterAnnotations(
|
||||||
|
@NotNull ProtoBuf.Callable.ValueParameter parameterProto
|
||||||
|
);
|
||||||
|
}
|
||||||
+23
-5
@@ -25,9 +25,7 @@ import org.jetbrains.jet.lang.descriptors.impl.ClassDescriptorBase;
|
|||||||
import org.jetbrains.jet.lang.descriptors.impl.ReceiverParameterDescriptorImpl;
|
import org.jetbrains.jet.lang.descriptors.impl.ReceiverParameterDescriptorImpl;
|
||||||
import org.jetbrains.jet.lang.resolve.OverrideResolver;
|
import org.jetbrains.jet.lang.resolve.OverrideResolver;
|
||||||
import org.jetbrains.jet.lang.resolve.TraceUtil;
|
import org.jetbrains.jet.lang.resolve.TraceUtil;
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.storage.MemoizedFunctionToNullableImpl;
|
import org.jetbrains.jet.lang.resolve.lazy.storage.*;
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.storage.NullableLazyValue;
|
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.storage.NullableLazyValueImpl;
|
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ClassReceiver;
|
import org.jetbrains.jet.lang.resolve.scopes.receivers.ClassReceiver;
|
||||||
@@ -46,6 +44,9 @@ public class DeserializedClassDescriptor extends ClassDescriptorBase implements
|
|||||||
|
|
||||||
private final NullableLazyValue<ConstructorDescriptor> primaryConstructor;
|
private final NullableLazyValue<ConstructorDescriptor> primaryConstructor;
|
||||||
|
|
||||||
|
private final AnnotationDeserializer annotationDeserializer;
|
||||||
|
private final NotNullLazyValue<List<AnnotationDescriptor>> annotations;
|
||||||
|
|
||||||
private final NestedClassResolver nestedClassResolver;
|
private final NestedClassResolver nestedClassResolver;
|
||||||
private final NullableLazyValue<ClassDescriptor> classObjectDescriptor;
|
private final NullableLazyValue<ClassDescriptor> classObjectDescriptor;
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ public class DeserializedClassDescriptor extends ClassDescriptorBase implements
|
|||||||
public DeserializedClassDescriptor(
|
public DeserializedClassDescriptor(
|
||||||
@NotNull DeclarationDescriptor containingDeclaration,
|
@NotNull DeclarationDescriptor containingDeclaration,
|
||||||
@NotNull NameResolver nameResolver,
|
@NotNull NameResolver nameResolver,
|
||||||
|
@NotNull AnnotationDeserializer annotationResolver,
|
||||||
@NotNull ClassResolver classResolver,
|
@NotNull ClassResolver classResolver,
|
||||||
@NotNull NestedClassResolver _nestedClassResolver,
|
@NotNull NestedClassResolver _nestedClassResolver,
|
||||||
@NotNull ProtoBuf.Class classProto,
|
@NotNull ProtoBuf.Class classProto,
|
||||||
@@ -70,7 +72,7 @@ public class DeserializedClassDescriptor extends ClassDescriptorBase implements
|
|||||||
) {
|
) {
|
||||||
this.classProto = classProto;
|
this.classProto = classProto;
|
||||||
this.typeDeserializer = new TypeDeserializer(outerTypeDeserializer, nameResolver, classResolver);
|
this.typeDeserializer = new TypeDeserializer(outerTypeDeserializer, nameResolver, classResolver);
|
||||||
this.deserializer = DescriptorDeserializer.create(typeDeserializer, this, nameResolver);
|
this.deserializer = DescriptorDeserializer.create(typeDeserializer, this, nameResolver, annotationResolver);
|
||||||
|
|
||||||
this.containingDeclaration = containingDeclaration;
|
this.containingDeclaration = containingDeclaration;
|
||||||
this.typeConstructor = new DeserializedClassTypeConstructor();
|
this.typeConstructor = new DeserializedClassTypeConstructor();
|
||||||
@@ -84,6 +86,15 @@ public class DeserializedClassDescriptor extends ClassDescriptorBase implements
|
|||||||
this.kind = DescriptorDeserializer.classKind(Flags.getClassKind(flags));
|
this.kind = DescriptorDeserializer.classKind(Flags.getClassKind(flags));
|
||||||
this.isInner = Flags.isInner(flags);
|
this.isInner = Flags.isInner(flags);
|
||||||
|
|
||||||
|
this.annotationDeserializer = annotationResolver;
|
||||||
|
this.annotations = new NotNullLazyValueImpl<List<AnnotationDescriptor>>() {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected List<AnnotationDescriptor> doCompute() {
|
||||||
|
return computeAnnotations();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this.primaryConstructor = new NullableLazyValueImpl<ConstructorDescriptor>() {
|
this.primaryConstructor = new NullableLazyValueImpl<ConstructorDescriptor>() {
|
||||||
@Override
|
@Override
|
||||||
protected ConstructorDescriptor doCompute() {
|
protected ConstructorDescriptor doCompute() {
|
||||||
@@ -169,9 +180,16 @@ public class DeserializedClassDescriptor extends ClassDescriptorBase implements
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<AnnotationDescriptor> computeAnnotations() {
|
||||||
|
if (!Flags.hasAnnotations(classProto.getFlags())) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return annotationDeserializer.loadClassAnnotations(classProto);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AnnotationDescriptor> getAnnotations() {
|
public List<AnnotationDescriptor> getAnnotations() {
|
||||||
return Collections.emptyList(); // TODO
|
return annotations.compute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+36
-2
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jetbrains.jet.ConfigurationKind;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||||
|
import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationDeserializer;
|
||||||
import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedClassDescriptor;
|
import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedClassDescriptor;
|
||||||
import org.jetbrains.jet.di.InjectorForJavaDescriptorResolver;
|
import org.jetbrains.jet.di.InjectorForJavaDescriptorResolver;
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.*;
|
||||||
@@ -49,11 +50,14 @@ import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
|||||||
import org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler;
|
import org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
||||||
|
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||||
import org.jetbrains.jet.test.util.NamespaceComparator;
|
import org.jetbrains.jet.test.util.NamespaceComparator;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationDeserializer.UNSUPPORTED;
|
||||||
|
|
||||||
public abstract class AbstractDescriptorSerializationTest extends KotlinTestWithEnvironment {
|
public abstract class AbstractDescriptorSerializationTest extends KotlinTestWithEnvironment {
|
||||||
|
|
||||||
public static final Name TEST_PACKAGE_NAME = Name.identifier("test");
|
public static final Name TEST_PACKAGE_NAME = Name.identifier("test");
|
||||||
@@ -74,6 +78,35 @@ public abstract class AbstractDescriptorSerializationTest extends KotlinTestWith
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static final AnnotationDeserializer DUMMY_ANNOTATION_DESERIALIZER = new AnnotationDeserializer() {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<AnnotationDescriptor> loadClassAnnotations(
|
||||||
|
@NotNull ProtoBuf.Class classProto
|
||||||
|
) {
|
||||||
|
// This is a hack for tests: only data annotations are present in test data so far
|
||||||
|
AnnotationDescriptor annotationDescriptor = new AnnotationDescriptor();
|
||||||
|
annotationDescriptor.setAnnotationType(KotlinBuiltIns.getInstance().getDataClassAnnotation().getDefaultType());
|
||||||
|
return Collections.singletonList(annotationDescriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<AnnotationDescriptor> loadCallableAnnotations(
|
||||||
|
@NotNull ProtoBuf.Callable callableProto
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException(); // TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<AnnotationDescriptor> loadValueParameterAnnotations(
|
||||||
|
@NotNull ProtoBuf.Callable.ValueParameter parameterProto
|
||||||
|
) {
|
||||||
|
throw new UnsupportedOperationException(); // TODO
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected JetCoreEnvironment createEnvironment() {
|
protected JetCoreEnvironment createEnvironment() {
|
||||||
return createEnvironmentWithMockJdk(ConfigurationKind.JDK_ONLY);
|
return createEnvironmentWithMockJdk(ConfigurationKind.JDK_ONLY);
|
||||||
@@ -184,7 +217,7 @@ public abstract class AbstractDescriptorSerializationTest extends KotlinTestWith
|
|||||||
}
|
}
|
||||||
|
|
||||||
DescriptorDeserializer deserializer =
|
DescriptorDeserializer deserializer =
|
||||||
DescriptorDeserializer.create(namespace, new NameResolver(simpleNames, qualifiedNames), classResolver);
|
DescriptorDeserializer.create(namespace, new NameResolver(simpleNames, qualifiedNames), classResolver, UNSUPPORTED);
|
||||||
for (ProtoBuf.Callable proto : callableProtos) {
|
for (ProtoBuf.Callable proto : callableProtos) {
|
||||||
CallableMemberDescriptor descriptor = deserializer.loadCallable(proto);
|
CallableMemberDescriptor descriptor = deserializer.loadCallable(proto);
|
||||||
if (descriptor instanceof FunctionDescriptor) {
|
if (descriptor instanceof FunctionDescriptor) {
|
||||||
@@ -359,7 +392,8 @@ public abstract class AbstractDescriptorSerializationTest extends KotlinTestWith
|
|||||||
};
|
};
|
||||||
|
|
||||||
NameResolver nameResolver = new NameResolver(classMetadata.simpleNames, classMetadata.qualifiedNames);
|
NameResolver nameResolver = new NameResolver(classMetadata.simpleNames, classMetadata.qualifiedNames);
|
||||||
return new DeserializedClassDescriptor(containingDeclaration, nameResolver, this, nestedClassResolver, classMetadata.classProto, null);
|
return new DeserializedClassDescriptor(containingDeclaration, nameResolver, DUMMY_ANNOTATION_DESERIALIZER,
|
||||||
|
this, nestedClassResolver, classMetadata.classProto, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
+12
-9
@@ -23,6 +23,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jetbrains.jet.ConfigurationKind;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.TestJdkKind;
|
import org.jetbrains.jet.TestJdkKind;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||||
|
import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationDeserializer;
|
||||||
import org.jetbrains.jet.jvm.compiler.ExpectedLoadErrorsUtil;
|
import org.jetbrains.jet.jvm.compiler.ExpectedLoadErrorsUtil;
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.*;
|
||||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||||
@@ -60,13 +61,13 @@ public class BuiltinsDeserializationTest extends KotlinTestWithEnvironment {
|
|||||||
|
|
||||||
NamespaceComparator.Configuration configuration = NamespaceComparator.RECURSIVE.withRenderer(
|
NamespaceComparator.Configuration configuration = NamespaceComparator.RECURSIVE.withRenderer(
|
||||||
new DescriptorRendererBuilder()
|
new DescriptorRendererBuilder()
|
||||||
.setWithDefinedIn(false)
|
.setWithDefinedIn(false)
|
||||||
.setExcludedAnnotationClasses(Arrays.asList(new FqName(ExpectedLoadErrorsUtil.ANNOTATION_CLASS_NAME)))
|
.setExcludedAnnotationClasses(Arrays.asList(new FqName(ExpectedLoadErrorsUtil.ANNOTATION_CLASS_NAME)))
|
||||||
.setOverrideRenderingPolicy(DescriptorRenderer.OverrideRenderingPolicy.RENDER_OPEN_OVERRIDE)
|
.setOverrideRenderingPolicy(DescriptorRenderer.OverrideRenderingPolicy.RENDER_OPEN_OVERRIDE)
|
||||||
.setVerbose(true)
|
.setVerbose(true)
|
||||||
.setAlwaysRenderAny(true)
|
.setAlwaysRenderAny(true)
|
||||||
.setPrettyFunctionTypes(false)
|
.setPrettyFunctionTypes(false)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
NamespaceComparator.validateAndCompareNamespaces(KotlinBuiltIns.getInstance().getBuiltInsPackage(), actualNamespace, configuration, null);
|
NamespaceComparator.validateAndCompareNamespaces(KotlinBuiltIns.getInstance().getBuiltInsPackage(), actualNamespace, configuration, null);
|
||||||
}
|
}
|
||||||
@@ -82,7 +83,7 @@ public class BuiltinsDeserializationTest extends KotlinTestWithEnvironment {
|
|||||||
|
|
||||||
NameResolver nameResolver = NameSerializationUtil.createNameResolver(serializer.getNameTable());
|
NameResolver nameResolver = NameSerializationUtil.createNameResolver(serializer.getNameTable());
|
||||||
|
|
||||||
ClassResolver classResolver = new AbstractClassResolver(nameResolver) {
|
ClassResolver classResolver = new AbstractClassResolver(nameResolver, AnnotationDeserializer.UNSUPPORTED) {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -177,7 +178,9 @@ public class BuiltinsDeserializationTest extends KotlinTestWithEnvironment {
|
|||||||
NameResolver nameResolver,
|
NameResolver nameResolver,
|
||||||
ClassResolver classResolver
|
ClassResolver classResolver
|
||||||
) {
|
) {
|
||||||
DescriptorDeserializer descriptorDeserializer = DescriptorDeserializer.create(actualNamespace, nameResolver, classResolver);
|
DescriptorDeserializer descriptorDeserializer;
|
||||||
|
descriptorDeserializer =
|
||||||
|
DescriptorDeserializer.create(actualNamespace, nameResolver, classResolver, AnnotationDeserializer.UNSUPPORTED);
|
||||||
for (ProtoBuf.Callable callableProto : callableProtos) {
|
for (ProtoBuf.Callable callableProto : callableProtos) {
|
||||||
CallableMemberDescriptor callableMemberDescriptor = descriptorDeserializer.loadCallable(callableProto);
|
CallableMemberDescriptor callableMemberDescriptor = descriptorDeserializer.loadCallable(callableProto);
|
||||||
if (callableMemberDescriptor instanceof PropertyDescriptor) {
|
if (callableMemberDescriptor instanceof PropertyDescriptor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user