Skip to content

Commit

Permalink
fix: ignore some very very old kotlin classes to prevent them breakin…
Browse files Browse the repository at this point in the history
…g remapping process (#1210)

* fix: ignore some very very old kotlin classes to prevent them breaking remapping process. Why? https://github.com/JetBrains/kotlin/blob/7c539b01f522d7ad458a3c774879277eccf03ffd/libraries/kotlinx-metadata/jvm/src/kotlin/metadata/jvm/KotlinClassMetadata.kt#L427

* fix: review suggestions
  • Loading branch information
zly2006 authored Nov 28, 2024
1 parent 816d778 commit 758dcb7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ class KotlinClassMetadataRemappingAnnotationVisitor(
"is using (${KotlinVersion.CURRENT}).",
)
}
val metadata = KotlinClassMetadata.readLenient(header)
if (metadata.version.major < 1 || (metadata.version.major == 1 && metadata.version.minor < 4)) {
logger.warn("$className is not supported by kotlin metadata remapping (version: ${metadata.version})")
accept(next)
return
}

when (val metadata = KotlinClassMetadata.readLenient(header)) {
when (metadata) {
is KotlinClassMetadata.Class -> {
var klass = metadata.kmClass
klass = KotlinClassRemapper(remapper).remap(klass)
Expand Down

0 comments on commit 758dcb7

Please sign in to comment.