bric3 / jd-intellij

Plugin that brought the first true Java decompiler in IntelliJ, now it's an alternative to the IntelliJ's integrated FernFlower. Note that updates are sparse just as my spare time ;)
http://plugins.jetbrains.com/plugin/7100
66 stars 20 forks source link

Plugin-Version 0.6 throws exception (PluginException caused by ClsElementImpl$InvalidMirrorException) #23

Closed bric3 closed 3 years ago

bric3 commented 10 years ago

Originally reported by: Christoph Ludwig (Bitbucket: chludwig_haufe, GitHub: Unknown)


Hi,

today, IntelliJ 13.1 (build #IU-135.480) prompted me to update the JD-IntelliJ plugin to version 0.6. Since the update, IntelliJ reports an internal error on every startup:

C:/Program Files (x86)/Java/jdk1.7.0_21/jre/lib/alt-rt.jar!/java/util/HashMap.class: stub:[]; mirror:[PsiTypeParameter:K, PsiTypeParameter:V] [Plugin: jd-intellij]
com.intellij.diagnostic.PluginException: stub:[]; mirror:[PsiTypeParameter:K, PsiTypeParameter:V] [Plugin: jd-intellij]
    at com.intellij.psi.impl.compiled.ClsFileImpl.a(ClsFileImpl.java:349)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:331)
    at com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:154)
    at com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:226)
    at com.intellij.psi.PsiDiamondTypeImpl$2.fun(PsiDiamondTypeImpl.java:228)
    at com.intellij.psi.PsiDiamondTypeImpl$2.fun(PsiDiamondTypeImpl.java:225)
    at com.intellij.openapi.util.text.StringUtil.join(StringUtil.java:1267)
    at com.intellij.openapi.util.text.StringUtil.join(StringUtil.java:1247)
    at com.intellij.openapi.util.text.StringUtil.join(StringUtil.java:1239)
    at com.intellij.psi.PsiDiamondTypeImpl.a(PsiDiamondTypeImpl.java:225)
    at com.intellij.psi.PsiDiamondTypeImpl.access$200(PsiDiamondTypeImpl.java:44)
    at com.intellij.psi.PsiDiamondTypeImpl$1.compute(PsiDiamondTypeImpl.java:145)
    at com.intellij.psi.PsiDiamondTypeImpl$1.compute(PsiDiamondTypeImpl.java:139)
    at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
    at com.intellij.psi.PsiDiamondTypeImpl.resolveInferredTypesNoCheck(PsiDiamondTypeImpl.java:139)
    at com.intellij.psi.PsiDiamondTypeImpl.resolveInferredTypes(PsiDiamondTypeImpl.java:130)
    at com.intellij.psi.impl.PsiDiamondTypeUtil.a(PsiDiamondTypeUtil.java:63)
    at com.intellij.psi.impl.PsiDiamondTypeUtil.canCollapseToDiamond(PsiDiamondTypeUtil.java:43)
    at com.intellij.codeInspection.ExplicitTypeCanBeDiamondInspection$1.visitNewExpression(ExplicitTypeCanBeDiamondInspection.java:67)
    at com.intellij.psi.impl.source.tree.java.PsiNewExpressionImpl.accept(PsiNewExpressionImpl.java:382)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:74)
    at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:63)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:356)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.access$000(LocalInspectionsPass.java:74)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$3.process(LocalInspectionsPass.java:325)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$3.process(LocalInspectionsPass.java:322)
    at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:119)
    at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:42)
    at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:82)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1153)
    at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:91)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:103)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:79)
    at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)
Caused by: com.intellij.psi.impl.compiled.ClsElementImpl$InvalidMirrorException: stub:[]; mirror:[PsiTypeParameter:K, PsiTypeParameter:V]
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:321)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:312)
    at com.intellij.psi.impl.compiled.ClsTypeParametersListImpl.setMirror(ClsTypeParametersListImpl.java:51)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299)
    at com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:414)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:324)
    at com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:422)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:324)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:312)
    at com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:280)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:328)
    ... 39 more

The plugin still decompiles class files when I open them in the IDE, but the error makes me worry for the IDE's stability...

Please let me know if you need any additional information.

Regards, Christoph


bric3 commented 8 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #47 was marked as a duplicate of this issue.

bric3 commented 9 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #44 was marked as a duplicate of this issue.

bric3 commented 9 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #43 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #40 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #39 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #37 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Alexander Bartash (Bitbucket: AlexanderBartash, GitHub: AlexanderBartash):


Issue #36 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #34 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #33 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Alexandre Teterin (Bitbucket: senleft, GitHub: senleft):


idea.log fragment

#!xml

2014-07-11 20:54:09,329 [26667219]  ERROR - .psi.impl.compiled.ClsFileImpl - IntelliJ IDEA 13.1.3  Build #IU-135.909 
2014-07-11 20:54:09,329 [26667219]  ERROR - .psi.impl.compiled.ClsFileImpl - JDK: 1.7.0_45 
2014-07-11 20:54:09,329 [26667219]  ERROR - .psi.impl.compiled.ClsFileImpl - VM: Java HotSpot(TM) 64-Bit Server VM 
2014-07-11 20:54:09,329 [26667219]  ERROR - .psi.impl.compiled.ClsFileImpl - Vendor: Oracle Corporation 
2014-07-11 20:54:09,329 [26667219]  ERROR - .psi.impl.compiled.ClsFileImpl - OS: Linux 
2014-07-11 20:54:09,329 [26667219]  ERROR - .psi.impl.compiled.ClsFileImpl - Last Action: EditorChooseLookupItem 
2014-07-11 20:54:09,329 [26667219]  ERROR - .psi.impl.compiled.ClsFileImpl - Current Command: Choose Lookup Item

Stacktrace: http://pastebin.com/3ELqc0PD

bric3 commented 10 years ago

Original comment by Danila Galimov (Bitbucket: dgalimov, GitHub: dgalimov):


IDEA version 14 shows this exception:

2014-07-07 17:45:36,403 [266870799] ERROR - .psi.impl.compiled.ClsFileImpl - F:/apache/maven_2/repo/org/mvel/mvel2/2.0.15-e1/mvel2-2.0.15-e1.jar!/org/mvel2/MVEL.class com.intellij.diagnostic.PluginException: BOOLEAN_KEYWORD != JAVA_CODE_REFERENCE [Plugin: jd-intellij] at com.intellij.psi.impl.compiled.ClsFileImpl.a(ClsFileImpl.java:361) at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:343) at com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:226) at com.intellij.psi.impl.compiled.ClsElementImpl.getTextLength(ClsElementImpl.java:174) at com.intellij.psi.impl.PsiDocumentManagerBase.getDocument(PsiDocumentManagerBase.java:170) at com.intellij.debugger.SourcePosition$SourcePositionCache.calcLine(SourcePosition.java:165) at com.intellij.debugger.SourcePosition$SourcePositionCache.getLine(SourcePosition.java:138) at com.intellij.debugger.impl.DebuggerUtilsEx.toXSourcePosition(DebuggerUtilsEx.java:625) at com.intellij.debugger.engine.JavaStackFrame$1.compute(JavaStackFrame.java:108) at com.intellij.debugger.engine.JavaStackFrame$1.compute(JavaStackFrame.java:104) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:964) at com.intellij.debugger.engine.JavaStackFrame.a(JavaStackFrame.java:104) at com.intellij.debugger.engine.JavaStackFrame.(JavaStackFrame.java:77) at com.intellij.debugger.engine.JavaExecutionStack$2.action(JavaExecutionStack.java:134) at com.intellij.debugger.engine.events.DebuggerCommandImpl.run(DebuggerCommandImpl.java:45) at com.intellij.debugger.engine.DebuggerManagerThreadImpl.processEvent(DebuggerManagerThreadImpl.java:151) at com.intellij.debugger.engine.DebuggerManagerThreadImpl.processEvent(DebuggerManagerThreadImpl.java:39) at com.intellij.debugger.impl.InvokeThread.a(InvokeThread.java:146) at com.intellij.debugger.impl.InvokeThread.access$100(InvokeThread.java:28) at com.intellij.debugger.impl.InvokeThread$WorkerThreadRequest.run(InvokeThread.java:55) at com.intellij.openapi.application.impl.ApplicationImpl$9.run(ApplicationImpl.java:446) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149) Caused by: com.intellij.psi.impl.compiled.ClsElementImpl$InvalidMirrorException: BOOLEAN_KEYWORD != JAVA_CODE_REFERENCE at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrorCheckingType(ClsElementImpl.java:288) at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.setMirror(ClsJavaCodeReferenceElementImpl.java:286) at com.intellij.psi.impl.compiled.ClsTypeElementImpl.setMirror(ClsTypeElementImpl.java:114) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299) at com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:239) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:324) at com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:421) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:324) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:312) at com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:292) at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:340) ... 25 more 2014-07-07 17:45:36,404 [266870800] ERROR - .psi.impl.compiled.ClsFileImpl - IntelliJ IDEA (Cassiopeia) IU-138.777 Build #IU-138.777 2014-07-07 17:45:36,404 [266870800] ERROR - .psi.impl.compiled.ClsFileImpl - JDK: 1.7.0_60 2014-07-07 17:45:36,404 [266870800] ERROR - .psi.impl.compiled.ClsFileImpl - VM: Java HotSpot(TM) 64-Bit Server VM 2014-07-07 17:45:36,404 [266870800] ERROR - .psi.impl.compiled.ClsFileImpl - Vendor: Oracle Corporation 2014-07-07 17:45:36,404 [266870800] ERROR - .psi.impl.compiled.ClsFileImpl - OS: Windows 7 2014-07-07 17:45:36,404 [266870800] ERROR - .psi.impl.compiled.ClsFileImpl - Last Action: Debug 2014-07-07 17:45:52,283 [266886679] INFO - Settings.impl.PluginDownloader - Plugin jd-intellij: current version (max) 0.6 2014-07-07 17:45:52,283 [266886679] INFO - Settings.impl.PluginDownloader - Plugin IntelliJad: current version (max) 1.4.3

bric3 commented 10 years ago

Original comment by mcgyver83 (Bitbucket: mcgyver83, GitHub: mcgyver83):


I have the same error line. class file are correctly decompiled but the debug could not hightlight the current line

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #32 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #31 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Danila Galimov (Bitbucket: dgalimov, GitHub: dgalimov):


This file also triggers plugin error, however, it seems to be decompiled correctly

bric3 commented 10 years ago

Original comment by Danila Galimov (Bitbucket: dgalimov, GitHub: dgalimov):


Array List from jdk 1.7.0_55 x64

bric3 commented 10 years ago

Original comment by Danila Galimov (Bitbucket: dgalimov, GitHub: dgalimov):


Not sure if it helps, but, for example, when I'm trying to open ArrayList.class in jdk 1.7.0_55, it failes to decompile method java.util.ArrayList#batchRemove

Please find the source and decompiled files attached.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #30 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Dzmitry Lazerka (Bitbucket: dlazerka, GitHub: dlazerka):


Happens on Linux Debian, IDEA IU-135.690, OpenJDK 1.7.0_21. Will be glad to help.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Yeah, yet their previous API worked. I 'm pretty sure it's about some default constructor or some generated stuff, that is not listed in our cleaned decompiled source code, but I need to check to be sure.

bric3 commented 10 years ago

Original comment by Danila Galimov (Bitbucket: dgalimov, GitHub: dgalimov):


15:49:17 PluginException: C:/Program Files/Java/jdk1.7.0_55/jre/lib/rt.jar!/java/util/HashMap.class: stub:[PsiTypeParameter:K, PsiTypeParameter:V]; mirror:[] [Plugin: jd-intellij] 16:45:21 PluginException: C:/Program Files/Java/jdk1.7.0_55/jre/lib/rt.jar!/java/util/ArrayList.class: stub:[PsiParameter, PsiParameter, PsiParameter, PsiParameter]; mirror:[PsiParameter:paramInt1, PsiParameter:paramInt2, PsiParameter:paramInt3] [Plugin: jd-intellij] 16:45:34 PluginException: C:/Program Files/Java/jdk1.7.0_55/jre/lib/rt.jar!/java/util/HashMap.class: stub:[PsiTypeParameter:K, PsiTypeParameter:V]; mirror:[] [Plugin: jd-intellij] 18:20:22 PluginException: C:/Program Files/Java/jdk1.7.0_55/jre/lib/rt.jar!/java/util/ArrayList.class: stub:[PsiParameter, PsiParameter, PsiParameter, PsiParameter]; mirror:[PsiParameter:paramInt1, PsiParameter:paramInt2, PsiParameter:paramInt3] [Plugin: jd-intellij]

bric3 commented 10 years ago

Original comment by Danila Galimov (Bitbucket: dgalimov, GitHub: dgalimov):


They are claiming this is not a bug. I'm getting it as well (Windows 7 x64, JDK 1.7.0_55 x64)

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


I created an issue on IntelliJ tracker : http://youtrack.jetbrains.com/issue/IDEA-124548

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


updated title so people konw what this issue is about

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #28 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #27 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Ok, I now see it also on OSX, I'll ask an IntelliJ developer as I don't think the plugin is in cause there. On the bright side, this issue shouldn't cause any problem when using the plugin but the annoying PluginException which happen from time to time.

bric3 commented 10 years ago

Original comment by Alexander Kriegisch (Bitbucket: kriegaex, GitHub: kriegaex):


Yes, I have. Afer the project is freshly re-indexed, I just open a Java file and - bang!

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #25 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


Issue #26 was marked as a duplicate of this issue.

bric3 commented 10 years ago

Original comment by Brice Dutheil (Bitbucket: bric3, GitHub: bric3):


I can't reproduce the error on OSX, IntelliJ 13.1. From the issues raised here, it seems only happening on Windows. I need to check on my windows machine, when free time is available.

Also it may be an issue within IntelliJ.

Caused by: com.intellij.psi.impl.compiled.ClsElementImpl$InvalidMirrorException: stub:[PsiParameter, PsiParameter, PsiParameter, PsiParameter]; mirror:[PsiParameter:paramInt1, PsiParameter:paramInt2, PsiParameter:paramInt3]

Have you tried to invalidate IntelliJ caches ?

bric3 commented 10 years ago

Original comment by Alexander Kriegisch (Bitbucket: kriegaex, GitHub: kriegaex):


@chludwig_haufe: Well, my stacktrace above also shows that it happens under 1.7.0_51. ;-)

Here are a few more error messages without full traces, only one-liners:

10:33:26 PluginException: C:/Program Files/Java/jdk1.7.0_51/jre/lib/rt.jar!/java/lang/Thread.class: stub:com.intellij.psi.impl.compiled.ClsDocCommentImpl@7885bbce; mirror:null [Plugin: jd-intellij]
10:52:35 PluginException: C:/Program Files/Java/jdk1.7.0_51/jre/lib/rt.jar!/java/util/ArrayList.class: stub:[PsiParameter, PsiParameter, PsiParameter, PsiParameter]; mirror:[PsiParameter:paramInt1, PsiParameter:paramInt2, PsiParameter:paramInt3] [Plugin: jd-intellij]
10:53:29 PluginException: C:/Program Files/Java/jdk1.7.0_51/jre/lib/rt.jar!/java/util/WeakHashMap.class: stub:[PsiTypeParameter:K, PsiTypeParameter:V]; mirror:[] [Plugin: jd-intellij]
10:53:46 PluginException: C:/Program Files/Java/jdk1.7.0_51/jre/lib/rt.jar!/java/util/HashMap.class: stub:[PsiTypeParameter:K, PsiTypeParameter:V]; mirror:[] [Plugin: jd-intellij]
11:48:24 PluginException: C:/Program Files/Java/jdk1.7.0_51/jre/lib/rt.jar!/java/util/ArrayList.class: stub:[PsiParameter, PsiParameter, PsiParameter, PsiParameter]; mirror:[PsiParameter:paramInt1, PsiParameter:paramInt2, PsiParameter:paramInt3] [Plugin: jd-intellij]
bric3 commented 10 years ago

Original comment by Christoph Ludwig (Bitbucket: chludwig_haufe, GitHub: Unknown):


Hi,

I don't know whether this information helps pinning down the exception's cause, but just in case:

Regards Christoph

bric3 commented 10 years ago

Original comment by Alexander Kriegisch (Bitbucket: kriegaex, GitHub: kriegaex):


Same here, no matter if I start idea.exe or idea64.exe. My call stack looks slightly different, but probably the reason is the same:

#!text

C:/Program Files/Java/jdk1.7.0_51/jre/lib/rt.jar!/java/util/ArrayList.class: stub:[PsiParameter, PsiParameter, PsiParameter, PsiParameter]; mirror:[PsiParameter:paramInt1, PsiParameter:paramInt2, PsiParameter:paramInt3] [Plugin: jd-intellij]
com.intellij.diagnostic.PluginException: stub:[PsiParameter, PsiParameter, PsiParameter, PsiParameter]; mirror:[PsiParameter:paramInt1, PsiParameter:paramInt2, PsiParameter:paramInt3] [Plugin: jd-intellij]
    at com.intellij.psi.impl.compiled.ClsFileImpl.a(ClsFileImpl.java:349)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:331)
    at com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:154)
    at com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:226)
    at com.intellij.psi.PsiDiamondTypeImpl$2.fun(PsiDiamondTypeImpl.java:228)
    at com.intellij.psi.PsiDiamondTypeImpl$2.fun(PsiDiamondTypeImpl.java:225)
    at com.intellij.openapi.util.text.StringUtil.join(StringUtil.java:1267)
    at com.intellij.openapi.util.text.StringUtil.join(StringUtil.java:1247)
    at com.intellij.openapi.util.text.StringUtil.join(StringUtil.java:1239)
    at com.intellij.psi.PsiDiamondTypeImpl.a(PsiDiamondTypeImpl.java:225)
    at com.intellij.psi.PsiDiamondTypeImpl.access$200(PsiDiamondTypeImpl.java:44)
    at com.intellij.psi.PsiDiamondTypeImpl$1.compute(PsiDiamondTypeImpl.java:145)
    at com.intellij.psi.PsiDiamondTypeImpl$1.compute(PsiDiamondTypeImpl.java:139)
    at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
    at com.intellij.psi.PsiDiamondTypeImpl.resolveInferredTypesNoCheck(PsiDiamondTypeImpl.java:139)
    at com.intellij.psi.PsiDiamondTypeImpl.resolveInferredTypes(PsiDiamondTypeImpl.java:130)
    at com.intellij.psi.PsiDiamondTypeImpl.resolveInferredTypes(PsiDiamondTypeImpl.java:112)
    at com.intellij.psi.PsiDiamondTypeImpl.resolveInferredTypes(PsiDiamondTypeImpl.java:108)
    at com.intellij.psi.impl.PsiImplUtil.typesByTypeElements(PsiImplUtil.java:284)
    at com.intellij.psi.impl.PsiImplUtil.typesByReferenceParameterList(PsiImplUtil.java:274)
    at com.intellij.psi.impl.source.tree.java.PsiReferenceParameterListImpl.getTypeArguments(PsiReferenceParameterListImpl.java:47)
    at com.intellij.codeInsight.folding.impl.JavaFoldingBuilderBase.a(JavaFoldingBuilderBase.java:321)
    at com.intellij.codeInsight.folding.impl.JavaFoldingBuilderBase.access$400(JavaFoldingBuilderBase.java:44)
    at com.intellij.codeInsight.folding.impl.JavaFoldingBuilderBase$1.visitNewExpression(JavaFoldingBuilderBase.java:717)
    at com.intellij.psi.impl.source.tree.java.PsiNewExpressionImpl.accept(PsiNewExpressionImpl.java:382)
    at com.intellij.psi.PsiWalkingState.visit(PsiWalkingState.java:61)
    at com.intellij.psi.PsiWalkingState.visit(PsiWalkingState.java:26)
    at com.intellij.util.WalkingState.walkChildren(WalkingState.java:65)
    at com.intellij.util.WalkingState.elementStarted(WalkingState.java:52)
    at com.intellij.psi.PsiWalkingState.elementStarted(PsiWalkingState.java:70)
    at com.intellij.psi.JavaRecursiveElementWalkingVisitor.visitElement(JavaRecursiveElementWalkingVisitor.java:34)
    at com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:68)
    at com.intellij.psi.impl.source.tree.java.PsiCodeBlockImpl.accept(PsiCodeBlockImpl.java:202)
    at com.intellij.codeInsight.folding.impl.JavaFoldingBuilderBase.a(JavaFoldingBuilderBase.java:696)
    at com.intellij.codeInsight.folding.impl.JavaFoldingBuilderBase.a(JavaFoldingBuilderBase.java:545)
    at com.intellij.codeInsight.folding.impl.JavaFoldingBuilderBase.buildLanguageFoldRegions(JavaFoldingBuilderBase.java:484)
    at com.intellij.lang.folding.CustomFoldingBuilder.buildFoldRegions(CustomFoldingBuilder.java:34)
    at com.intellij.lang.folding.LanguageFolding.buildFoldingDescriptors(LanguageFolding.java:83)
    at com.intellij.lang.folding.CompositeFoldingBuilder.buildFoldRegions(CompositeFoldingBuilder.java:57)
    at com.intellij.lang.folding.LanguageFolding.buildFoldingDescriptors(LanguageFolding.java:83)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate.a(FoldingUpdate.java:205)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate.a(FoldingUpdate.java:118)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate.access$000(FoldingUpdate.java:52)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate$2.compute(FoldingUpdate.java:104)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate$2.compute(FoldingUpdate.java:99)
    at com.intellij.psi.impl.PsiParameterizedCachedValue.doCompute(PsiParameterizedCachedValue.java:53)
    at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:199)
    at com.intellij.psi.impl.PsiParameterizedCachedValue.getValue(PsiParameterizedCachedValue.java:43)
    at com.intellij.psi.util.CachedValuesManager.getParameterizedCachedValue(CachedValuesManager.java:77)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate.updateFoldRegions(FoldingUpdate.java:98)
    at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl.a(CodeFoldingManagerImpl.java:303)
    at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl.updateFoldRegionsAsync(CodeFoldingManagerImpl.java:295)
    at com.intellij.codeInsight.daemon.impl.CodeFoldingPass.doCollectInformation(CodeFoldingPass.java:46)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:61)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:380)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1153)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:371)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:368)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:344)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask.exec(JobLauncherImpl.java:193)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)
Caused by: com.intellij.psi.impl.compiled.ClsElementImpl$InvalidMirrorException: stub:[PsiParameter, PsiParameter, PsiParameter, PsiParameter]; mirror:[PsiParameter:paramInt1, PsiParameter:paramInt2, PsiParameter:paramInt3]
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:321)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:312)
    at com.intellij.psi.impl.compiled.ClsParameterListImpl.setMirror(ClsParameterListImpl.java:65)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299)
    at com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:242)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:324)
    at com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:421)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:324)
    at com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:422)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:299)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:324)
    at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:312)
    at com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:280)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:328)
    ... 65 more
bric3 commented 3 years ago

Let's close this issue, as I don't know if this will be reproduced with recent IntelliJ and newer JD-Core

bric3 commented 3 years ago

Another one on hotspot 8 (AdoptOpenJdk), with jdk.internal.dynalink.DefaultBootstrapper

In the stack trace below, the message indicate the following different between the stub (which is how IJ interracts with a class like navigating, autocompletion, etc.), and the mirror which is the decompiled text.

I this case, like in many we see the stub has a default constructor (DefaultBootstrapper), but the mirror don't have it (jd skips the default constructor if there's no instructions).

stub:[PsiMethod:DefaultBootstrapper, PsiMethod:bootstrap, PsiMethod:publicBootstrap, PsiMethod:bootstrapInternal]; 
mirror:[PsiMethod:bootstrap, PsiMethod:publicBootstrap, PsiMethod:bootstrapInternal]
ClsFileImpl.decompile (stub) version of jdk.internal.dynalink.DefaultBootstrapper // IntelliJ API Decompiler stub source generated from a class file // Implementation of methods is not available package jdk.internal.dynalink; public class DefaultBootstrapper { private static final jdk.internal.dynalink.DynamicLinker dynamicLinker; private DefaultBootstrapper() { /* compiled code */ } public static java.lang.invoke.CallSite bootstrap(java.lang.invoke.MethodHandles.Lookup caller, java.lang.String name, java.lang.invoke.MethodType type) { /* compiled code */ } public static java.lang.invoke.CallSite publicBootstrap(java.lang.invoke.MethodHandles.Lookup caller, java.lang.String name, java.lang.invoke.MethodType type) { /* compiled code */ } private static java.lang.invoke.CallSite bootstrapInternal(java.lang.invoke.MethodHandles.Lookup caller, java.lang.String name, java.lang.invoke.MethodType type) { /* compiled code */ } }
Java Decompiler (mirror) version of jdk.internal.dynalink.DefaultBootstrapper /* Location: jar:///Users/brice/.sdkman/candidates/java/8.0.292.hs-adpt/jre/lib/ext/nashorn.jar!/jdk/internal/dynalink/DefaultBootstrapper.class * Java language version: 7 * Class File: 51.0 * JD-Core Version: 1.1.3 */ package jdk.internal.dynalink; import java.lang.invoke.CallSite; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import jdk.internal.dynalink.support.CallSiteDescriptorFactory; public class DefaultBootstrapper { private static final DynamicLinker dynamicLinker = (new DynamicLinkerFactory()).createLinker(); public static CallSite bootstrap(MethodHandles.Lookup caller, String name, MethodType type) { return bootstrapInternal(caller, name, type); } public static CallSite publicBootstrap(MethodHandles.Lookup caller, String name, MethodType type) { return bootstrapInternal(MethodHandles.publicLookup(), name, type); } private static CallSite bootstrapInternal(MethodHandles.Lookup caller, String name, MethodType type) { return dynamicLinker.link(new MonomorphicCallSite(CallSiteDescriptorFactory.create(caller, name, type))); } }
PluginException / InvalidMirrorException ``` jar:///Users/brice/.sdkman/candidates/java/8.0.292.hs-adpt/jre/lib/ext/nashorn.jar!/jdk/internal/dynalink/DefaultBootstrapper.class com.intellij.diagnostic.PluginException: stub:[PsiMethod:DefaultBootstrapper, PsiMethod:bootstrap, PsiMethod:publicBootstrap, PsiMethod:bootstrapInternal]; mirror:[PsiMethod:bootstrap, PsiMethod:publicBootstrap, PsiMethod:bootstrapInternal] [Plugin: jd-intellij] at com.intellij.psi.impl.compiled.ClsFileImpl.wrapException(ClsFileImpl.java:387) at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:355) at com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:140) at com.intellij.psi.impl.compiled.ClsElementImpl.getTextOffset(ClsElementImpl.java:177) at com.intellij.ide.util.EditSourceUtil.getDescriptor(EditSourceUtil.java:41) at com.intellij.ide.util.PsiNavigationSupportImpl.getDescriptor(PsiNavigationSupportImpl.java:31) at com.intellij.psi.impl.PsiElementBase.navigate(PsiElementBase.java:194) at com.intellij.codeInsight.navigation.NavigationUtil.lambda$openFileWithPsiElement$2(NavigationUtil.java:178) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:216) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:172) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:162) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:148) at com.intellij.codeInsight.navigation.NavigationUtil.openFileWithPsiElement(NavigationUtil.java:171) at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:235) at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:245) at com.intellij.util.OpenSourceUtil.navigateToSource(OpenSourceUtil.java:119) at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:74) at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:58) at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:51) at com.intellij.util.OpenSourceUtil.openSourcesFrom(OpenSourceUtil.java:19) at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.processDoubleClick(EditSourceOnDoubleClickHandler.java:166) at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.onDoubleClick(EditSourceOnDoubleClickHandler.java:160) at com.intellij.ui.DoubleClickListener.onClick(DoubleClickListener.java:30) at com.intellij.ui.ClickListener$1.mouseReleased(ClickListener.java:59) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345) at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:392) at com.intellij.ide.dnd.aware.DnDAwareTree.processMouseEvent(DnDAwareTree.java:45) at java.desktop/java.awt.Component.processEvent(Component.java:6417) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:906) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:836) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: com.intellij.psi.impl.compiled.ClsElementImpl$InvalidMirrorException: stub:[PsiMethod:DefaultBootstrapper, PsiMethod:bootstrap, PsiMethod:publicBootstrap, PsiMethod:bootstrapInternal]; mirror:[PsiMethod:bootstrap, PsiMethod:publicBootstrap, PsiMethod:bootstrapInternal] at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:274) at com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:451) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirror(ClsElementImpl.java:256) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:277) at com.intellij.psi.impl.compiled.ClsElementImpl.setMirrors(ClsElementImpl.java:269) at com.intellij.psi.impl.compiled.ClsFileImpl.setFileMirror(ClsFileImpl.java:300) at com.intellij.psi.impl.compiled.ClsFileImpl.lambda$getMirror$1(ClsFileImpl.java:350) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64) at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:218) at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:349) ... 66 more ```
bric3 commented 3 years ago

See this thread on the SDK forum : https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010821700-Some-classes-decompiled-via-custom-ClassFileDecompilers-Light-produce-InvalidMirrorException-stub-PsiMethod-Checker-?page=1