Fix NPE on empty JVM name

#KT-9113 Fixed
This commit is contained in:
Alexander Udalov
2015-09-09 15:09:03 +03:00
parent fb31980c0b
commit 3e5c8d1b79
7 changed files with 24 additions and 11 deletions
@@ -562,8 +562,8 @@ public class DescriptorUtils {
}
@Nullable
public static String getJvmName(@NotNull Annotations annotations) {
AnnotationDescriptor jvmNameAnnotation = getJvmNameAnnotation(annotations);
public static String getJvmName(@NotNull Annotated annotated) {
AnnotationDescriptor jvmNameAnnotation = getJvmNameAnnotation(annotated.getAnnotations());
if (jvmNameAnnotation == null) return null;
Map<ValueParameterDescriptor, ConstantValue<?>> arguments = jvmNameAnnotation.getAllValueArguments();
@@ -575,11 +575,6 @@ public class DescriptorUtils {
return ((StringValue) name).getValue();
}
@Nullable
public static String getJvmName(@NotNull Annotated annotated) {
return getJvmName(annotated.getAnnotations());
}
@Nullable
public static AnnotationDescriptor getJvmNameAnnotation(@NotNull Annotations annotations) {
AnnotationDescriptor jvmNameAnnotation = annotations.findAnnotation(JVM_NAME);