Vineflower / vineflower-intellij

Intellij IDEA plugin that adds Vineflower support
MIT License
40 stars 12 forks source link

Non-breaking: Error thrown while opening Kotlin source file #25

Closed gdude2002 closed 2 months ago

gdude2002 commented 2 months ago

Notes

Exception thrown when opening this file, which causes the problem reporter to surface an error.

Doesn't seem to actually break anything, though.

Stacktrace

jrt://C:/Program Files/Eclipse Adoptium/jdk-17.0.4.101-hotspot!/java.base/java/lang/Boolean.class

com.intellij.diagnostic.PluginException: stub:{}; mirror:null [Plugin: net.earthcomputer.quiltflowerintellij]
    at com.intellij.psi.impl.compiled.ClsFileImpl.wrapException(ClsFileImpl.java:388)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:356)
    at org.jetbrains.uast.kotlin.BaseKotlinInternalUastUtilsKt.unwrapFakeFileForLightClass(baseKotlinInternalUastUtils.kt:41)
    at org.jetbrains.uast.kotlin.FirKotlinUastLanguagePlugin.isSupportedElement(FirKotlinUastLanguagePlugin.kt:46)
    at org.jetbrains.uast.kotlin.FirKotlinUastLanguagePlugin.convertElementWithParent(FirKotlinUastLanguagePlugin.kt:65)
    at org.jetbrains.uast.UastFacade.convertElementWithParent(UastContext.kt:66)
    at org.jetbrains.uast.UastContextKt.toUElement(UastContext.kt:153)
    at com.intellij.codeInspection.UnstableApiUsageProcessor.checkTargetReferencesUnstableTypeInSignature(UnstableApiUsageInspection.kt:162)
    at com.intellij.codeInspection.UnstableApiUsageProcessor.checkUnstableApiUsage(UnstableApiUsageInspection.kt:132)
    at com.intellij.codeInspection.UnstableApiUsageProcessor.processReference(UnstableApiUsageInspection.kt:97)
    at com.intellij.codeInspection.apiUsage.ApiUsageUastVisitor.visitCallExpression(ApiUsageUastVisitor.kt:156)
    at org.jetbrains.uast.UCallExpression.accept(UCallExpression.kt:94)
    at com.intellij.uast.UastVisitorAdapter.visitElement(UastVisitorAdapter.java:32)
    at org.jetbrains.kotlin.psi.KtElementImpl.accept(KtElementImpl.java:54)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner$InspectionProblemHolder.visitElement(InspectionRunner.java:598)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processContext$20(InspectionRunner.java:415)
    at com.intellij.codeInsight.daemon.impl.InspectionVisitorOptimizer.acceptElements(InspectionVisitorOptimizer.java:197)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.processContext(InspectionRunner.java:413)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$inspect$7(InspectionRunner.java:192)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:291)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$executeInImpatientReadAction$17(InspectionRunner.java:394)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:158)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:150)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$executeInImpatientReadAction$18(InspectionRunner.java:385)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:129)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:118)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.executeInImpatientReadAction(InspectionRunner.java:385)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$inspect$8(InspectionRunner.java:191)
    at com.intellij.concurrency.JobLauncherImpl$2MyProcessQueueTask.lambda$call$0(JobLauncherImpl.java:494)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.concurrency.JobLauncherImpl$2MyProcessQueueTask.call(JobLauncherImpl.java:483)
    at com.intellij.concurrency.JobLauncherImpl$2MyProcessQueueTask.call(JobLauncherImpl.java:471)
    at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1602)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
Caused by: com.intellij.psi.impl.compiled.ClsElementImpl$InvalidMirrorException: stub:{}; mirror:null
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrorIfPresent(ClsElementImpl.java:248)
    at com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:202)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:243)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:264)
    at com.intellij.psi.impl.compiled.ClsClassImpl.setMirrorsChecked(ClsClassImpl.java:464)
    at com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:448)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:243)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:264)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:256)
    at com.intellij.psi.impl.compiled.ClsFileImpl.setFileMirror(ClsFileImpl.java:303)
    at com.intellij.psi.impl.compiled.ClsFileImpl.lambda$getMirror$1(ClsFileImpl.java:351)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:269)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:277)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:62)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:277)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:268)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:350)
    ... 41 more

Environment

Plugin: Vineflower 1.1 Kotlin plugin running in K2 mode

IntelliJ IDEA 2024.2.0.1 (Ultimate Edition)
Build #IU-242.20224.387, built on August 13, 2024
Runtime version: 21.0.3+13-b509.4 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
Kotlin plugin: K2 mode (Beta)
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 32
Registry:
  ide.balloon.shadow.size=0
  ide.experimental.ui=true
  ide.editor.tab.selection.animation=true
  terminal.new.ui=true
  eslint.additional.file.extensions=svelte
  editor.minimap.enabled=true
Non-Bundled Plugins:
  com.jetbrains.plugins.ini4idea (242.20224.385)
  org.jetbrains.projector-plugin (1.11.2)
  com.nasller.CodeGlancePro (1.8.8)
  com.github.catppuccin.jetbrains (3.3.1)
  net.earthcomputer.quiltflowerintellij (1.1)
  com.khmelyuk.multirun (1.14.1)
  com.markskelton.one-dark-theme (5.11.0)
  com.intellij.ideolog (242.20224.385)
  com.haulmont.jpab (242.20224.300)
  String Manipulation (9.14.1)
  org.jetbrains.plugins.localization (242.20224.159)
  com.intellij.properties.bundle.editor (242.20224.155)
  de.docs_as_co.intellij.plugin.diagramsnet (0.2.6)
  tarn.gradle.dependencies (1.6.2)
  FluentLanguage (0.4.2)
  dev.turingcomplete.intellij-gradle-utilities-plugin (1.2.5)
  GrepConsole (13.1.0-IJ2023.3)
  com.intellij.ml.llm (242.20224.393)
  com.intellij.grazie.pro (0.3.326)
  org.asciidoctor.intellij.asciidoc (0.42.2)
  com.intellij.nativeDebug (242.20224.155)
  ru.adelf.idea.dotenv (2024.2.1)
  com.laravel_idea.tailwind (1.4.2)
  org.intellij.prisma (242.20224.159)
  izhangzhihao.rainbow.brackets (2024.2.6-241)
  com.intellij.bigdatatools.core (242.20224.387)
  com.intellij.bigdatatools.binary.files (242.20224.159)
  com.intellij.bigdatatools.rfs (242.20224.387)
  com.intellij.bigdatatools.metastore.core (242.20224.159)
  com.intellij.bigdatatools.flink (242.20224.159)
  com.intellij.exposed (242.20224.159)
  dev.blachut.svelte.lang (242.20224.155)
  com.mallowigi.colorHighlighter (18.0.0)
  mdx.js (242.20224.159)
  zielu.gitworktree (1.0.6+231)
  com.mallowigi (97.0.0)
  zielu.gittoolbox (500.2.14+242)
  mobi.hsz.idea.gitignore (4.5.3)
  com.intellij.bigdatatools.kafka (242.20224.159)
  com.intellij.bigdatatools.spark (242.20224.159)
  com.intellij.bigdatatools.zeppelin (242.20224.159)
Kotlin: 242.20224.387-IJ
Earthcomputer commented 2 months ago

Kotlin stubs are better supported already (just not quite released yet). Any other manifestations of this issue are #1