Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module-info.java in compilation source causes IllegalStateException #68

Closed
sandwwraith opened this issue Aug 25, 2021 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@sandwwraith
Copy link
Member

Reproducer: Kotlin/kotlinx.serialization#1624
Exception:

Caused by: java.lang.IllegalStateException: superName must not be null
        at kotlinx.validation.api.KotlinSignaturesLoadingKt$loadApiFromJvmClasses$4.invoke(KotlinSignaturesLoading.kt:56)
        at kotlinx.validation.api.KotlinSignaturesLoadingKt$loadApiFromJvmClasses$4.invoke(KotlinSignaturesLoading.kt)
        at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:172)
        at kotlin.collections.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:1206)
        at kotlin.collections.CollectionsKt___CollectionsKt.toMutableList(_Collections.kt:1239)
        at kotlin.collections.CollectionsKt___CollectionsKt.sortedWith(_Collections.kt:988)
        at kotlinx.validation.api.KotlinSignaturesLoadingKt.loadApiFromJvmClasses(KotlinSignaturesLoading.kt:162)
        at kotlinx.validation.api.KotlinSignaturesLoadingKt.loadApiFromJvmClasses$default(KotlinSignaturesLoading.kt:20)
        at kotlinx.validation.KotlinApiBuildTask.generate(KotlinApiBuildTask.kt:49)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)

Cause:
https://github.com/Kotlin/binary-compatibility-validator/blob/master/src/main/kotlin/api/KotlinSignaturesLoading.kt#L41
superName is null for module-info class. ASM and validator do not expect that.
Possible solutions: make superName nullable or just filter out such classes.

Note that visibilityFilter is actually not used anywhere, filtering by fq name (ignoredClasses) happens after loading ASM.

@qwwdfsad
Copy link
Member

Fixed in 0.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants