Drop obsolete synthetic class kind in KotlinClassHeader
This commit is contained in:
+1
-6
@@ -23,7 +23,6 @@ class KotlinClassHeader(
|
|||||||
val version: BinaryVersion,
|
val version: BinaryVersion,
|
||||||
val annotationData: Array<String>?,
|
val annotationData: Array<String>?,
|
||||||
val strings: Array<String>?,
|
val strings: Array<String>?,
|
||||||
val syntheticClassKind: String?,
|
|
||||||
val filePartClassNames: Array<String>?,
|
val filePartClassNames: Array<String>?,
|
||||||
val multifileClassName: String?,
|
val multifileClassName: String?,
|
||||||
val isInterfaceDefaultImpls: Boolean,
|
val isInterfaceDefaultImpls: Boolean,
|
||||||
@@ -37,11 +36,7 @@ class KotlinClassHeader(
|
|||||||
SYNTHETIC_CLASS
|
SYNTHETIC_CLASS
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString() =
|
override fun toString() = "$kind " + (if (isLocalClass) "(local) " else "") + "version=$version"
|
||||||
"$kind " +
|
|
||||||
(if (isLocalClass) "(local) " else "") +
|
|
||||||
(if (syntheticClassKind != null) "$syntheticClassKind " else "") +
|
|
||||||
"version=$version"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun KotlinClassHeader.isCompatibleClassKind(): Boolean = version.isCompatible() && kind == KotlinClassHeader.Kind.CLASS
|
fun KotlinClassHeader.isCompatibleClassKind(): Boolean = version.isCompatible() && kind == KotlinClassHeader.Kind.CLASS
|
||||||
|
|||||||
+2
-27
@@ -51,7 +51,6 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
|||||||
private String[] annotationData = null;
|
private String[] annotationData = null;
|
||||||
private String[] strings = null;
|
private String[] strings = null;
|
||||||
private KotlinClassHeader.Kind headerKind = null;
|
private KotlinClassHeader.Kind headerKind = null;
|
||||||
private String syntheticClassKind = null;
|
|
||||||
private boolean isInterfaceDefaultImpls = false;
|
private boolean isInterfaceDefaultImpls = false;
|
||||||
private boolean isLocalClass = false;
|
private boolean isLocalClass = false;
|
||||||
|
|
||||||
@@ -71,8 +70,7 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new KotlinClassHeader(
|
return new KotlinClassHeader(
|
||||||
headerKind, version, annotationData, strings, syntheticClassKind, filePartClassNames, multifileClassName,
|
headerKind, version, annotationData, strings, filePartClassNames, multifileClassName, isInterfaceDefaultImpls, isLocalClass
|
||||||
isInterfaceDefaultImpls, isLocalClass
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,18 +101,7 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
|||||||
KotlinClassHeader.Kind newKind = HEADER_KINDS.get(classId);
|
KotlinClassHeader.Kind newKind = HEADER_KINDS.get(classId);
|
||||||
if (newKind != null) {
|
if (newKind != null) {
|
||||||
headerKind = newKind;
|
headerKind = newKind;
|
||||||
|
return new HeaderAnnotationArgumentVisitor();
|
||||||
switch (newKind) {
|
|
||||||
case CLASS:
|
|
||||||
case FILE_FACADE:
|
|
||||||
case MULTIFILE_CLASS:
|
|
||||||
case MULTIFILE_CLASS_PART:
|
|
||||||
return new HeaderAnnotationArgumentVisitor();
|
|
||||||
case SYNTHETIC_CLASS:
|
|
||||||
return new SyntheticClassHeaderReader();
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -227,16 +214,4 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
|||||||
protected abstract void visitEnd(@NotNull String[] data);
|
protected abstract void visitEnd(@NotNull String[] data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SyntheticClassHeaderReader extends HeaderAnnotationArgumentVisitor {
|
|
||||||
@Override
|
|
||||||
public void visitEnum(@NotNull Name name, @NotNull ClassId enumClassId, @NotNull Name enumEntryName) {
|
|
||||||
if ("Kind".equals(enumClassId.getShortClassName().asString()) &&
|
|
||||||
enumClassId.isNestedClass() &&
|
|
||||||
enumClassId.getOuterClassId().equals(ClassId.topLevel(KOTLIN_SYNTHETIC_CLASS)) &&
|
|
||||||
"kind".equals(name.asString())) {
|
|
||||||
syntheticClassKind = enumEntryName.asString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ fun isKotlinInternalCompiledFile(file: VirtualFile): Boolean {
|
|||||||
|
|
||||||
return header.kind == KotlinClassHeader.Kind.SYNTHETIC_CLASS ||
|
return header.kind == KotlinClassHeader.Kind.SYNTHETIC_CLASS ||
|
||||||
header.kind == KotlinClassHeader.Kind.MULTIFILE_CLASS_PART ||
|
header.kind == KotlinClassHeader.Kind.MULTIFILE_CLASS_PART ||
|
||||||
header.isLocalClass || header.syntheticClassKind == "PACKAGE_PART"
|
header.isLocalClass
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findMultifileClassParts(file: VirtualFile, classId: ClassId, kotlinClassHeader: KotlinClassHeader): List<KotlinJvmBinaryClass> {
|
fun findMultifileClassParts(file: VirtualFile, classId: ClassId, kotlinClassHeader: KotlinClassHeader): List<KotlinJvmBinaryClass> {
|
||||||
|
|||||||
Reference in New Issue
Block a user