Don't mark primitive types as @NotNull

This commit is contained in:
Andrey Breslav
2013-11-11 13:09:43 +04:00
parent f3901d2844
commit 0959f7e37c
4 changed files with 72 additions and 1 deletions
@@ -106,7 +106,10 @@ public abstract class AnnotationCodegen {
private void generateNullabilityAnnotation(@Nullable JetType type, @NotNull Set<String> annotationDescriptorsAlreadyPresent) {
if (type == null) return;
Class<?> annotationClass = CodegenUtil.isNullableType(type) ? Nullable.class : NotNull.class;
boolean isNullableType = CodegenUtil.isNullableType(type);
if (!isNullableType && KotlinBuiltIns.getInstance().isPrimitiveType(type)) return;
Class<?> annotationClass = isNullableType ? Nullable.class : NotNull.class;
String descriptor = Type.getType(annotationClass).getDescriptor();
if (!annotationDescriptorsAlreadyPresent.contains(descriptor)) {