Rename JvmClassName.getFqName() and add a warning

All usages of this method as of right now seem wrong, as they don't work in the
case of classes which contain dollars in their names -- dollars get replaced to
dots
This commit is contained in:
Alexander Udalov
2013-10-03 19:56:43 +04:00
parent e8d4aae48b
commit dbba6c614b
6 changed files with 11 additions and 6 deletions
@@ -77,8 +77,11 @@ public class JvmClassName {
this.internalName = internalName;
}
/**
* WARNING: internal name cannot be converted to FQ name for a class which contains dollars in the name
*/
@NotNull
public FqName getFqName() {
public FqName getFqNameForClassNameWithoutDollars() {
if (fqName == null) {
fqName = new FqName(internalNameToFqName(internalName));
}
@@ -210,7 +210,8 @@ public class AnnotationDescriptorDeserializer implements AnnotationDeserializer
@NotNull
private ClassDescriptor resolveClass(@NotNull JvmClassName className) {
ClassDescriptor annotationClass = javaClassResolver.resolveClass(className.getFqName(), IGNORE_KOTLIN_SOURCES);
ClassDescriptor annotationClass = javaClassResolver.resolveClass(className.getFqNameForClassNameWithoutDollars(),
IGNORE_KOTLIN_SOURCES);
return annotationClass != null ? annotationClass : ErrorUtils.getErrorClass();
}