reading annotations from bytecode
(without fields yet)
This commit is contained in:
+1
-1
@@ -133,7 +133,7 @@ public class LazySubstitutingClassDescriptor implements ClassDescriptor {
|
||||
|
||||
@Override
|
||||
public List<AnnotationDescriptor> getAnnotations() {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
return original.getAnnotations();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+5
-1
@@ -40,7 +40,7 @@ public class MutableClassDescriptorLite extends MutableDeclarationDescriptor imp
|
||||
private ConstructorDescriptor primaryConstructor;
|
||||
private final Set<ConstructorDescriptor> constructors = Sets.newLinkedHashSet();
|
||||
|
||||
private final List<AnnotationDescriptor> annotations = Lists.newArrayList();
|
||||
private List<AnnotationDescriptor> annotations = Lists.newArrayList();
|
||||
|
||||
private Map<String, ClassDescriptor> innerClassesAndObjects = Maps.newHashMap();
|
||||
|
||||
@@ -342,4 +342,8 @@ public class MutableClassDescriptorLite extends MutableDeclarationDescriptor imp
|
||||
public List<AnnotationDescriptor> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public void setAnnotations(List<AnnotationDescriptor> annotations) {
|
||||
this.annotations = annotations;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -17,9 +17,11 @@
|
||||
package org.jetbrains.jet.lang.descriptors.annotations;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
|
||||
import javax.rmi.CORBA.ClassDesc;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -40,6 +42,9 @@ public class AnnotationDescriptor {
|
||||
}
|
||||
|
||||
public void setAnnotationType(@NotNull JetType annotationType) {
|
||||
if (!(annotationType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor)) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
this.annotationType = annotationType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user