Drop isLocalClass, do not write KotlinLocalClass
This commit is contained in:
+1
-2
@@ -35,7 +35,6 @@ public final class JvmAnnotationNames {
|
||||
public static final FqName KOTLIN_MULTIFILE_CLASS_PART = new FqName("kotlin.jvm.internal.KotlinMultifileClassPart");
|
||||
public static final FqName KOTLIN_SYNTHETIC_CLASS = new FqName("kotlin.jvm.internal.KotlinSyntheticClass");
|
||||
public static final FqName KOTLIN_FUNCTION = new FqName("kotlin.jvm.internal.KotlinFunction");
|
||||
public static final FqName KOTLIN_LOCAL_CLASS = new FqName("kotlin.jvm.internal.KotlinLocalClass");
|
||||
|
||||
public static final String VERSION_FIELD_NAME = "version";
|
||||
public static final String METADATA_VERSION_FIELD_NAME = "mv";
|
||||
@@ -72,7 +71,7 @@ public final class JvmAnnotationNames {
|
||||
private static final Set<JvmClassName> NULLABILITY_ANNOTATIONS = new HashSet<JvmClassName>();
|
||||
private static final Set<JvmClassName> SPECIAL_META_ANNOTATIONS = new HashSet<JvmClassName>();
|
||||
static {
|
||||
for (FqName fqName : Arrays.asList(METADATA, KOTLIN_CLASS, KOTLIN_SYNTHETIC_CLASS, KOTLIN_LOCAL_CLASS)) {
|
||||
for (FqName fqName : Arrays.asList(METADATA, KOTLIN_CLASS, KOTLIN_SYNTHETIC_CLASS)) {
|
||||
SPECIAL_ANNOTATIONS.add(JvmClassName.byFqNameWithoutInnerClasses(fqName));
|
||||
}
|
||||
|
||||
|
||||
+2
-11
@@ -25,8 +25,7 @@ class KotlinClassHeader(
|
||||
val bytecodeVersion: JvmBytecodeBinaryVersion,
|
||||
val data: Array<String>?,
|
||||
val strings: Array<String>?,
|
||||
val multifileClassName: String?,
|
||||
val isLocalClass: Boolean
|
||||
val multifileClassName: String?
|
||||
) {
|
||||
// See kotlin.Metadata
|
||||
enum class Kind(val id: Int) {
|
||||
@@ -47,15 +46,7 @@ class KotlinClassHeader(
|
||||
|
||||
enum class SyntheticClassKind(val id: Int) {
|
||||
FUNCTION(1),
|
||||
LOCAL_CLASS(2);
|
||||
|
||||
companion object {
|
||||
private val entryById = values().toMapBy(SyntheticClassKind::id)
|
||||
|
||||
@JvmStatic
|
||||
fun getById(id: Int) = entryById[id]
|
||||
}
|
||||
}
|
||||
|
||||
override fun toString() = "$kind " + (if (isLocalClass) "(local) " else "") + "version=$metadataVersion"
|
||||
override fun toString() = "$kind version=$metadataVersion"
|
||||
}
|
||||
|
||||
+1
-14
@@ -53,8 +53,6 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
||||
private String[] data = null;
|
||||
private String[] strings = null;
|
||||
private KotlinClassHeader.Kind headerKind = null;
|
||||
private KotlinClassHeader.SyntheticClassKind syntheticClassKind = null;
|
||||
private boolean isLocalClass = false;
|
||||
|
||||
@Nullable
|
||||
public KotlinClassHeader createHeader() {
|
||||
@@ -77,8 +75,7 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
||||
bytecodeVersion != null ? bytecodeVersion : JvmBytecodeBinaryVersion.INVALID_VERSION,
|
||||
data,
|
||||
strings,
|
||||
multifileClassName,
|
||||
isLocalClass || syntheticClassKind == KotlinClassHeader.SyntheticClassKind.LOCAL_CLASS
|
||||
multifileClassName
|
||||
);
|
||||
}
|
||||
|
||||
@@ -98,11 +95,6 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
||||
|
||||
if (IGNORE_OLD_METADATA) return null;
|
||||
|
||||
if (KOTLIN_LOCAL_CLASS.equals(fqName)) {
|
||||
isLocalClass = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (headerKind != null) {
|
||||
// Ignore all Kotlin annotations except the first found
|
||||
return null;
|
||||
@@ -142,11 +134,6 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
||||
bytecodeVersion = new JvmBytecodeBinaryVersion((int[]) value);
|
||||
}
|
||||
}
|
||||
else if (SYNTHETIC_CLASS_KIND_FIELD_NAME.equals(string)) {
|
||||
if (value instanceof Integer) {
|
||||
syntheticClassKind = KotlinClassHeader.SyntheticClassKind.getById((Integer) value);
|
||||
}
|
||||
}
|
||||
else if (METADATA_MULTIFILE_CLASS_NAME_FIELD_NAME.equals(string)) {
|
||||
if (value instanceof String) {
|
||||
multifileClassName = (String) value;
|
||||
|
||||
Reference in New Issue
Block a user