The last workaround is not working for some people. Unfortunately, I can't reproduce the issue. If you review this PR, please make sure that you can reproduce the exception first!
java.lang.RuntimeException: Cannot write field 'myLightBulb' in class 'class jetbrains.mps.nodeEditor.IntentionsSupport' of object: jetbrains.mps.nodeEditor.IntentionsSupport@610df18
at com.mbeddr.mpsutil.intentions.runtime.ReflectionUtil_copy.writeField(ReflectionUtil_copy.java:31)
at com.mbeddr.mpsutil.intentions.runtime.OriginalIntentionMenu.(OriginalIntentionMenu.java:67)
at com.mbeddr.mpsutil.intentions.runtime.IntentionsMenuWithGroups.(IntentionsMenuWithGroups.java:33)
at com.mbeddr.mpsutil.intentions.runtime.plugin.IntentionsProjectPlugin_ProjectPluginPart$1.editorComponentCreate(IntentionsProjectPlugin_ProjectPluginPart.java:19)
at de.slisson.mps.hacks.editor.EditorComponentCreationListener.install(EditorComponentCreationListener.java:33)
at jetbrains.mps.ide.editor.EditorExtensionRegistryImpl.installExtensions(EditorExtensionRegistryImpl.java:123)
at jetbrains.mps.ide.editor.EditorExtensionRegistryImpl.extend(EditorExtensionRegistryImpl.java:107)
at jetbrains.mps.openapi.editor.extensions.EditorExtensionUtil.extendUsingProject(EditorExtensionUtil.java:30)
at jetbrains.mps.vcs.diff.ui.common.DiffEditor$1.visit(DiffEditor.java:91)
at jetbrains.mps.vcs.diff.ui.common.DiffEditor$1.visit(DiffEditor.java:89)
at jetbrains.mps.internal.collections.runtime.IVisitor.invoke(IVisitor.java:12)
at jetbrains.mps.internal.collections.runtime.IterableUtils.visitAll(IterableUtils.java:16)
at jetbrains.mps.internal.collections.runtime.AbstractSequence.visitAll(AbstractSequence.java:80)
at jetbrains.mps.vcs.diff.ui.common.DiffEditor.(DiffEditor.java:89)
at jetbrains.mps.vcs.diff.ui.RootDifferencePaneBase.createEditorsGroup(RootDifferencePaneBase.java:490)
at jetbrains.mps.vcs.diff.ui.RootDifferencePaneBase.(RootDifferencePaneBase.java:105)
at jetbrains.mps.vcs.diff.ui.TwoSideRootDifferencePane.(TwoSideRootDifferencePane.java:28)
at jetbrains.mps.vcs.diff.ui.ModelDifferenceViewer.lambda$changeCurrentRoot$7(ModelDifferenceViewer.java:314)
at jetbrains.mps.smodel.ActionDispatcher.dispatch(ActionDispatcher.java:98)
at jetbrains.mps.smodel.ActionDispatcher.lambda$wrap$0(ActionDispatcher.java:135)
at jetbrains.mps.smodel.LockRunnable.run(LockRunnable.java:60)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:915)
at jetbrains.mps.smodel.WorkbenchModelAccess.runReadAction(WorkbenchModelAccess.java:84)
at jetbrains.mps.smodel.ModelAccessBase.runReadAction(ModelAccessBase.java:56)
at jetbrains.mps.vcs.diff.ui.ModelDifferenceViewer.changeCurrentRoot(ModelDifferenceViewer.java:310)
at jetbrains.mps.vcs.diff.ui.ModelDifferenceViewer$ModelDifferenceTree.onSelectRoot(ModelDifferenceViewer.java:466)
at jetbrains.mps.vcs.diff.ui.common.DiffModelTree$2.valueChanged(DiffModelTree.java:77)
at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:650)
at com.intellij.ui.treeStructure.Tree$MySelectionModel.fireValueChanged(Tree.java:647)
at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1120)
at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:306)
at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:200)
at java.desktop/javax.swing.JTree.setSelectionPath(JTree.java:1709)
at jetbrains.mps.vcs.diff.ui.common.DiffModelTree.setSelected(DiffModelTree.java:154)
at jetbrains.mps.vcs.diff.ui.common.DiffModelTree.rebuildNow(DiffModelTree.java:169)
at jetbrains.mps.vcs.diff.ui.ModelDifferenceViewer.showDiff(ModelDifferenceViewer.java:160)
at jetbrains.mps.vcs.platform.integration.ModelDiffViewer.(ModelDiffViewer.java:94)
at jetbrains.mps.vcs.platform.integration.ModelDiffTool.createComponent(ModelDiffTool.java:27)
at com.intellij.diff.impl.DiffRequestProcessor.createState(DiffRequestProcessor.java:328)
at com.intellij.diff.impl.DiffRequestProcessor.lambda$doApplyRequest$4(DiffRequestProcessor.java:405)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:223)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:238)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:222)
at com.intellij.diff.impl.DiffRequestProcessor.lambda$doApplyRequest$5(DiffRequestProcessor.java:399)
at com.intellij.diff.util.DiffUtil.runPreservingFocus(DiffUtil.java:788)
at com.intellij.diff.impl.DiffRequestProcessor.doApplyRequest(DiffRequestProcessor.java:387)
at com.intellij.diff.impl.DiffRequestProcessor.lambda$applyRequest$3(DiffRequestProcessor.java:369)
at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:172)
at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:113)
at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:179)
at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:132)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:163)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:169)
at com.intellij.diff.impl.DiffRequestProcessor.applyRequest(DiffRequestProcessor.java:377)
at com.intellij.diff.impl.DiffRequestProcessor.applyRequest(DiffRequestProcessor.java:356)
at com.intellij.diff.impl.CacheDiffRequestProcessor.lambda$updateRequest$0(CacheDiffRequestProcessor.java:117)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.finish(BackgroundTaskUtil.java:113)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.executeAndTryWait(BackgroundTaskUtil.java:101)
at com.intellij.diff.util.DiffTaskQueue.executeAndTryWait(DiffTaskQueue.java:47)
at com.intellij.diff.util.DiffTaskQueue.executeAndTryWait(DiffTaskQueue.java:38)
at com.intellij.diff.impl.CacheDiffRequestProcessor.updateRequest(CacheDiffRequestProcessor.java:112)
at com.intellij.diff.impl.CacheDiffRequestProcessor.updateRequest(CacheDiffRequestProcessor.java:91)
at com.intellij.diff.impl.DiffRequestProcessor.updateRequest(DiffRequestProcessor.java:239)
at com.intellij.diff.impl.DiffRequestProcessor.updateRequest(DiffRequestProcessor.java:234)
at com.intellij.openapi.vcs.changes.ChangeViewDiffRequestProcessor.setCurrentChange(ChangeViewDiffRequestProcessor.java:204)
at com.intellij.openapi.vcs.changes.ChangeViewDiffRequestProcessor.refresh(ChangeViewDiffRequestProcessor.java:185)
at com.intellij.openapi.vcs.changes.ChangeViewDiffRequestProcessor.updatePreview(ChangeViewDiffRequestProcessor.java:110)
at com.intellij.vcs.log.ui.frame.VcsLogChangeProcessor.updatePreview(VcsLogChangeProcessor.java:82)
at com.intellij.vcs.log.ui.frame.VcsLogEditorDiffPreview.createDiffRequestProcessor(VcsLogDiffPreview.kt:146)
at com.intellij.openapi.vcs.changes.PreviewDiffVirtualFile.createProcessor(PreviewDiffVirtualFile.java:34)
at com.intellij.diff.editor.DiffEditorProvider.createEditor(DiffEditorProvider.kt:36)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.createComposite(FileEditorManagerImpl.java:1086)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4Edt(FileEditorManagerImpl.java:987)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$17(FileEditorManagerImpl.java:960)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.runBulkTabChange(FileEditorManagerImpl.java:1697)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$18(FileEditorManagerImpl.java:959)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:492)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:525)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:956)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl2$14(FileEditorManagerImpl.java:884)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:883)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:764)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:724)
at com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.openFile(FileEditorManagerEx.java:127)
at com.intellij.openapi.vcs.changes.VcsEditorTabFilesManager.openFile(VcsEditorTabFilesManager.kt:74)
at com.intellij.openapi.vcs.changes.VcsEditorTabFilesManager.openFile(VcsEditorTabFilesManager.kt:60)
at com.intellij.openapi.vcs.changes.EditorTabDiffPreviewManager.showDiffFile(EditorTabDiffPreviewManager.kt:37)
at com.intellij.openapi.vcs.changes.EditorTabPreviewBase$Companion.openPreview(EditorTabPreview.kt:188)
at com.intellij.vcs.log.ui.frame.EditorDiffPreview.openPreview(VcsLogDiffPreview.kt:120)
at com.intellij.openapi.vcs.changes.DiffPreview$DefaultImpls.performDiffAction(DiffPreview.kt:21)
at com.intellij.vcs.log.ui.frame.EditorDiffPreview.performDiffAction(VcsLogDiffPreview.kt:99)
at com.intellij.vcs.log.ui.frame.VcsLogEditorDiffPreview.performDiffAction(VcsLogDiffPreview.kt:183)
at com.intellij.openapi.vcs.changes.ui.ChangesBrowserBase.showDiff(ChangesBrowserBase.java:307)
at com.intellij.openapi.vcs.changes.ui.ChangesBrowserBase.onDoubleClick(ChangesBrowserBase.java:223)
at com.intellij.openapi.vcs.changes.ui.ChangesTree.lambda$setDoubleClickAndEnterKeyHandler$3(ChangesTree.java:263)
at com.intellij.openapi.vcs.changes.ui.ChangesTreeHandlers$createDoubleClickListener$1.onDoubleClick(ChangesTreeHandlers.kt:52)
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.Component.processMouseEvent(Component.java:6648)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3392)
at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:422)
at java.desktop/java.awt.Component.processEvent(Component.java:6413)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at com.intellij.openapi.vcs.changes.ui.ChangesTree.processEvent(ChangesTree.java:763)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5022)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2802)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:754)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:752)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:751)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:743)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: java.lang.NoSuchFieldException: modifiers
at java.base/java.lang.Class.getDeclaredField(Class.java:2610)
at com.mbeddr.mpsutil.intentions.runtime.ReflectionUtil_copy.writeField(ReflectionUtil_copy.java:24)
... 149 more
The last workaround is not working for some people. Unfortunately, I can't reproduce the issue. If you review this PR, please make sure that you can reproduce the exception first!
More information about this topic: https://stackoverflow.com/questions/56039341/get-declared-fields-of-java-lang-reflect-fields-in-jdk12/56043252#56043252
The original exception was: