@NotNull annotations on descriptor classes

This commit is contained in:
Andrey Breslav
2013-11-19 16:37:17 +04:00
parent 6dde064791
commit 0c2e1fb806
16 changed files with 24 additions and 0 deletions
@@ -68,6 +68,7 @@ class RootContext extends CodegenContext {
throw new IllegalStateException();
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
throw new IllegalStateException();
@@ -268,6 +268,7 @@ public class TypeDeserializer {
return descriptor != null && ErrorUtils.isError(descriptor);
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return Collections.emptyList();
@@ -199,11 +199,13 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
return annotationDeserializer.loadClassAnnotations(this, classProto);
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return annotations.invoke();
}
@NotNull
@Override
protected JetScope getScopeForMemberLookup() {
return memberScope;
@@ -359,6 +361,7 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
return DeserializedClassDescriptor.this;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return Collections.emptyList(); // TODO
@@ -166,6 +166,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyDesc
});
}
@NotNull
@Override
protected JetScope getScopeForMemberLookup() {
return unsubstitutedMemberScope;
@@ -330,6 +331,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyDesc
return thisAsReceiverParameter.invoke();
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return annotations.invoke();
@@ -479,6 +481,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyDesc
return LazyClassDescriptor.this;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return Collections.emptyList(); // TODO
@@ -85,6 +85,7 @@ public class DeferredType implements JetType {
return getActualType().isNullable();
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return getActualType().getAnnotations();
@@ -16,11 +16,13 @@
package org.jetbrains.jet.lang.descriptors.annotations;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.ReadOnly;
import java.util.List;
public interface Annotated {
@ReadOnly
@NotNull
List<AnnotationDescriptor> getAnnotations();
}
@@ -16,6 +16,8 @@
package org.jetbrains.jet.lang.descriptors.annotations;
import org.jetbrains.annotations.NotNull;
import java.util.List;
public abstract class AnnotatedImpl implements Annotated {
@@ -25,6 +27,7 @@ public abstract class AnnotatedImpl implements Annotated {
this.annotations = annotations;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return annotations;
@@ -33,6 +33,7 @@ public abstract class AbstractClassDescriptor implements ClassDescriptor {
return this;
}
@NotNull
protected abstract JetScope getScopeForMemberLookup();
@NotNull
@@ -179,6 +179,7 @@ public abstract class AbstractLazyTypeParameterDescriptor implements TypeParamet
return AbstractLazyTypeParameterDescriptor.this;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return AbstractLazyTypeParameterDescriptor.this.getAnnotations();
@@ -248,6 +249,7 @@ public abstract class AbstractLazyTypeParameterDescriptor implements TypeParamet
return index;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return Collections.emptyList(); // TODO
@@ -117,6 +117,7 @@ public class LazySubstitutingClassDescriptor implements ClassDescriptor {
return r;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return original.getAnnotations();
@@ -210,6 +210,7 @@ public abstract class MutableClassDescriptorLite extends ClassDescriptorBase {
}
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return annotations;
@@ -49,6 +49,7 @@ public abstract class NumberValueTypeConstructor implements TypeConstructor {
return null;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return Collections.emptyList();
@@ -406,6 +406,7 @@ public class ErrorUtils {
return true;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return Collections.emptyList();
@@ -57,6 +57,7 @@ public final class JetTypeImpl extends AbstractJetType {
classDescriptor.getMemberScope(Collections.<TypeProjection>emptyList()));
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
return annotations;
@@ -78,6 +78,7 @@ public class NamespaceType implements JetType {
return false;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
throwException();
@@ -84,6 +84,7 @@ public class TypeUtils {
return false;
}
@NotNull
@Override
public List<AnnotationDescriptor> getAnnotations() {
throw new IllegalStateException(name);