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

Consider using UAST #69

Closed
YannCebron opened this issue Mar 24, 2021 · 1 comment
Closed

Consider using UAST #69

YannCebron opened this issue Mar 24, 2021 · 1 comment
Milestone

Comments

@YannCebron
Copy link

YannCebron commented Mar 24, 2021

Kotlin 1.4.32 introduces binary incompatibility with org.mapstruct.intellij:1.2.3

Method org.mapstruct.intellij.util.MapstructUtilKt.toPsiMethod(org.jetbrains.kotlin.psi.KtNamedFunction $this$toPsiMethod) : com.intellij.psi.PsiMethod contains an *invokestatic* instruction referencing an unresolved method org.jetbrains.kotlin.asJava.classes.UltraLightUtilsKt.createGeneratedMethodFromDescriptor(org.jetbrains.kotlin.asJava.classes.KtUltraLightClass, org.jetbrains.kotlin.descriptors.FunctionDescriptor, org.jetbrains.kotlin.psi.KtDeclaration) : org.jetbrains.kotlin.asJava.elements.KtLightMethod. This can lead to **NoSuchMethodError** exception at runtime.

If possible (didn't check your plugin's usage of Kotlin plugin specific API), consider switching to UAST which will shield you from such problems and allow common code for all supported JVM Languages. Reference: https://plugins.jetbrains.com/docs/intellij/uast.html

@filiphr
Copy link
Member

filiphr commented Mar 24, 2021

Thanks a lot for the hint @YannCebron. I was not aware about the UAST.

The particular problem code is happening when called from here and the problematic code is here.

I guess that it shouldn't be too difficult to get the javaPsi from the UAST so we can do the logic without relying on Kotlin specifics.

This functionality was contributed by a contributor and I had (and still have) limited knowledge of the Kotlin plugin.

@filiphr filiphr added this to the 1.2.4 milestone Mar 24, 2021
ifrankwang added a commit to ifrankwang/mapstruct-idea that referenced this issue Mar 26, 2021
filiphr pushed a commit that referenced this issue Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants