Fix KotlinGradleIT.testCustomCompilerFile
Referencing org.jetbrains.annotations.{Nullable, NotNull} classes in
static initializer causes ClassNotFoundError in testCustomCompilerFile.
This commit is contained in:
@@ -50,9 +50,6 @@ import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getA
|
|||||||
|
|
||||||
public abstract class AnnotationCodegen {
|
public abstract class AnnotationCodegen {
|
||||||
|
|
||||||
private static final String ORG_JETBRAINS_ANNOTATIONS_NOTNULL = Type.getType(NotNull.class).getDescriptor();
|
|
||||||
private static final String ORG_JETBRAINS_ANNOTATIONS_NULLABLE = Type.getType(Nullable.class).getDescriptor();
|
|
||||||
|
|
||||||
public static final class JvmFlagAnnotation {
|
public static final class JvmFlagAnnotation {
|
||||||
private final FqName fqName;
|
private final FqName fqName;
|
||||||
private final int jvmFlag;
|
private final int jvmFlag;
|
||||||
@@ -251,15 +248,17 @@ public abstract class AnnotationCodegen {
|
|||||||
if (!TypeUtils.isNullableType(flexibleType.getLowerBound()) && TypeUtils.isNullableType(flexibleType.getUpperBound())) {
|
if (!TypeUtils.isNullableType(flexibleType.getLowerBound()) && TypeUtils.isNullableType(flexibleType.getUpperBound())) {
|
||||||
AnnotationDescriptor notNull = type.getAnnotations().findAnnotation(JvmAnnotationNames.JETBRAINS_NOT_NULL_ANNOTATION);
|
AnnotationDescriptor notNull = type.getAnnotations().findAnnotation(JvmAnnotationNames.JETBRAINS_NOT_NULL_ANNOTATION);
|
||||||
if (notNull != null) {
|
if (notNull != null) {
|
||||||
generateAnnotationIfNotPresent(annotationDescriptorsAlreadyPresent, ORG_JETBRAINS_ANNOTATIONS_NOTNULL, false);
|
generateAnnotationIfNotPresent(annotationDescriptorsAlreadyPresent, Type.getType(NotNull.class).getDescriptor(), false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String annotationDescriptor =
|
generateAnnotationIfNotPresent(
|
||||||
TypeUtils.isNullableType(type) ? ORG_JETBRAINS_ANNOTATIONS_NULLABLE : ORG_JETBRAINS_ANNOTATIONS_NOTNULL;
|
annotationDescriptorsAlreadyPresent,
|
||||||
generateAnnotationIfNotPresent(annotationDescriptorsAlreadyPresent, annotationDescriptor, false);
|
TypeUtils.isNullableType(type) ? Type.getType(Nullable.class).getDescriptor() : Type.getType(NotNull.class).getDescriptor(),
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<JvmTarget, Map<KotlinTarget, ElementType>> annotationTargetMaps = new EnumMap<>(JvmTarget.class);
|
private static final Map<JvmTarget, Map<KotlinTarget, ElementType>> annotationTargetMaps = new EnumMap<>(JvmTarget.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user