Delete getFqName() method from KotlinClassFileHeader
It's not related to the header. Add getClassName() method to KotlinJvmBinaryClass, which reads the internal name of the class
This commit is contained in:
+21
@@ -34,6 +34,7 @@ import static org.jetbrains.asm4.Opcodes.ASM4;
|
||||
|
||||
public class VirtualFileKotlinClass implements KotlinJvmBinaryClass {
|
||||
private final VirtualFile file;
|
||||
private JvmClassName className;
|
||||
|
||||
public VirtualFileKotlinClass(@NotNull VirtualFile file) {
|
||||
this.file = file;
|
||||
@@ -45,6 +46,26 @@ public class VirtualFileKotlinClass implements KotlinJvmBinaryClass {
|
||||
return file;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public JvmClassName getClassName() {
|
||||
if (className == null) {
|
||||
try {
|
||||
new ClassReader(file.contentsToByteArray()).accept(new ClassVisitor(ASM4) {
|
||||
@Override
|
||||
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
|
||||
className = JvmClassName.byInternalName(name);
|
||||
}
|
||||
}, SKIP_CODE | SKIP_DEBUG | SKIP_FRAMES);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw ExceptionUtils.rethrow(e);
|
||||
}
|
||||
}
|
||||
|
||||
return className;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadClassAnnotations(@NotNull final AnnotationVisitor annotationVisitor) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user