Drop KotlinClassHeader#filePartClassNames, use 'data' instead
This commit is contained in:
+1
-1
@@ -119,7 +119,7 @@ public final class DeserializedDescriptorResolver {
|
||||
errorReporter.reportIncompatibleMetadataVersion(kotlinClass.getClassId(), kotlinClass.getLocation(), header.getMetadataVersion());
|
||||
}
|
||||
else if (expectedKinds.contains(header.getKind())) {
|
||||
return header.getAnnotationData();
|
||||
return header.getData();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+1
-2
@@ -23,9 +23,8 @@ class KotlinClassHeader(
|
||||
val kind: KotlinClassHeader.Kind,
|
||||
val metadataVersion: JvmMetadataVersion,
|
||||
val bytecodeVersion: JvmBytecodeBinaryVersion,
|
||||
val annotationData: Array<String>?,
|
||||
val data: Array<String>?,
|
||||
val strings: Array<String>?,
|
||||
val filePartClassNames: Array<String>?,
|
||||
val multifileClassName: String?,
|
||||
val isInterfaceDefaultImpls: Boolean,
|
||||
val isLocalClass: Boolean
|
||||
|
||||
+6
-20
@@ -48,8 +48,7 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
||||
private JvmMetadataVersion metadataVersion = null;
|
||||
private JvmBytecodeBinaryVersion bytecodeVersion = null;
|
||||
private String multifileClassName = null;
|
||||
private String[] filePartClassNames = null;
|
||||
private String[] annotationData = null;
|
||||
private String[] data = null;
|
||||
private String[] strings = null;
|
||||
private KotlinClassHeader.Kind headerKind = null;
|
||||
private boolean isInterfaceDefaultImpls = false;
|
||||
@@ -62,9 +61,9 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
||||
}
|
||||
|
||||
if (metadataVersion == null || !metadataVersion.isCompatible()) {
|
||||
annotationData = null;
|
||||
data = null;
|
||||
}
|
||||
else if (shouldHaveData() && annotationData == null) {
|
||||
else if (shouldHaveData() && data == null) {
|
||||
// This means that the annotation is found and its ABI version is compatible, but there's no "data" string array in it.
|
||||
// We tell the outside world that there's really no annotation at all
|
||||
return null;
|
||||
@@ -74,7 +73,7 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
||||
headerKind,
|
||||
metadataVersion != null ? metadataVersion : JvmMetadataVersion.INVALID_VERSION,
|
||||
bytecodeVersion != null ? bytecodeVersion : JvmBytecodeBinaryVersion.INVALID_VERSION,
|
||||
annotationData, strings, filePartClassNames, multifileClassName, isInterfaceDefaultImpls, isLocalClass
|
||||
data, strings, multifileClassName, isInterfaceDefaultImpls, isLocalClass
|
||||
);
|
||||
}
|
||||
|
||||
@@ -140,36 +139,23 @@ public class ReadKotlinClassHeaderAnnotationVisitor implements AnnotationVisitor
|
||||
@Nullable
|
||||
public AnnotationArrayArgumentVisitor visitArray(@NotNull Name name) {
|
||||
String string = name.asString();
|
||||
if (DATA_FIELD_NAME.equals(string)) {
|
||||
if (DATA_FIELD_NAME.equals(string) || FILE_PART_CLASS_NAMES_FIELD_NAME.equals(string)) {
|
||||
return dataArrayVisitor();
|
||||
}
|
||||
else if (STRINGS_FIELD_NAME.equals(string)) {
|
||||
return stringsArrayVisitor();
|
||||
}
|
||||
else if (FILE_PART_CLASS_NAMES_FIELD_NAME.equals(string)) {
|
||||
return filePartClassNamesVisitor();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private AnnotationArrayArgumentVisitor filePartClassNamesVisitor() {
|
||||
return new CollectStringArrayAnnotationVisitor() {
|
||||
@Override
|
||||
protected void visitEnd(@NotNull String[] data) {
|
||||
filePartClassNames = data;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private AnnotationArrayArgumentVisitor dataArrayVisitor() {
|
||||
return new CollectStringArrayAnnotationVisitor() {
|
||||
@Override
|
||||
protected void visitEnd(@NotNull String[] data) {
|
||||
annotationData = data;
|
||||
ReadKotlinClassHeaderAnnotationVisitor.this.data = data;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user