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

Class cast exception in MapStruct Support plugin. #53

Closed
gloss82 opened this issue Jul 7, 2020 · 1 comment
Closed

Class cast exception in MapStruct Support plugin. #53

gloss82 opened this issue Jul 7, 2020 · 1 comment

Comments

@gloss82
Copy link

gloss82 commented Jul 7, 2020

Mapstruct Plugin 1.2.1

IntelliJ IDEA 2020.1.2 (Ultimate Edition)
Build #IU-201.7846.76, built on June 1, 2020
Licensed to **********
Subscription is active until September 23, 2020
Runtime version: 11.0.7+10-b765.53 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-40-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 24
Non-Bundled Plugins: GenerateSerialVersionUID, Lombook Plugin, org.mapstruct.intellij, MavenRunHelper, org.jetbrains.kotlin, cn.wuzhizhan.plugin.mybatis
Current Desktop: ubuntu:GNOME

Stack trace:

java.lang.ClassCastException: class com.intellij.psi.impl.source.tree.java.PsiNameValuePairImpl cannot be cast to class com.intellij.psi.PsiMethod (com.intellij.psi.impl.source.tree.java.PsiNameValuePairImpl and com.intellij.psi.PsiMethod are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @18f7cdd9)
	at org.mapstruct.intellij.expression.JavaExpressionInjector.getLanguagesToInject(JavaExpressionInjector.java:94)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:423)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.probeElementsUp(InjectedLanguageUtil.java:345)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.enumerate(InjectedLanguageUtil.java:164)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.enumerateEx(InjectedLanguageManagerImpl.java:321)
	at com.intellij.codeInsight.daemon.impl.InjectedGeneralHighlightingPass.lambda$getInjectedPsiFiles$3(InjectedGeneralHighlightingPass.java:184)
	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
	at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
	at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:168)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:168)
	at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
	at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
@filiphr
Copy link
Member

filiphr commented Jul 7, 2020

Thanks for raising the issue. This has already been fixed with #52. We'll do a release soon. FYI this only happens with @Mappings is used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants