mbeddr / mbeddr.core

The mbeddr core. An extensible C
Eclipse Public License 2.0
225 stars 77 forks source link

com.mbeddr.mpsutil.datepicker does not work when look and feel set to macOS light #2203

Open brucetrask2 opened 3 years ago

brucetrask2 commented 3 years ago

Using 2020.3.5 but may be a problem with 2021 as well. When using com.mbeddr.mpsutil.datepicker there seems to be some class loading issues when the look and feel from MPS preferences is set to macOS light. It works fine with the other look and feels such as Darcula and intelliJLight. Data from @sergej-koscejev : "This bug could be worked around by using a shadowed version of the microba.jar (where a prefix is prepended to all the class names)." When appearance is set to macOS light and I load and editor that uses a simple datepicker cell, I get the following stacktrace:

java.lang.ClassCastException: class com.mbeddr.mpsutil.datepicker.runtime.model.MpsDatePicker cannot be cast to class com.michaelbaranov.microba.calendar.DatePicker (com.mbeddr.mpsutil.datepicker.runtime.model.MpsDatePicker is in unnamed module of loader jetbrains.mps.classloading.ModuleClassLoader @5f01f64f; com.michaelbaranov.microba.calendar.DatePicker is in unnamed module of loader com.intellij.util.lang.UrlClassLoader @210366b4)

at com.michaelbaranov.microba.calendar.ui.basic.BasicDatePickerUI.installUI(BasicDatePickerUI.java:65)

at java.desktop/javax.swing.JComponent.setUI(JComponent.java:688)

at com.michaelbaranov.microba.common.MicrobaComponent.updateUI(MicrobaComponent.java:44)

at com.michaelbaranov.microba.calendar.CalendarPane.(CalendarPane.java:196)

at com.michaelbaranov.microba.calendar.DatePicker.(DatePicker.java:120)

at com.michaelbaranov.microba.calendar.DatePicker.(DatePicker.java:82)

at com.mbeddr.mpsutil.datepicker.runtime.model.MpsDatePicker.(MpsDatePicker.java:25)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createDatePickerCell_0(Target_EditorBuilder_a.java:221)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createDatePickerCell_1(Target_EditorBuilder_a.java:267)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createCollection_3(Target_EditorBuilder_a.java:196)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createCollection_2(Target_EditorBuilder_a.java:185)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createCollapsible_0(Target_EditorBuilder_a.java:153)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createCollapsible_1(Target_EditorBuilder_a.java:180)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createCollection_1(Target_EditorBuilder_a.java:104)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createCollection_0(Target_EditorBuilder_a.java:91)

at ProgramsLanguage.editor.Target_EditorBuilder_a.createCell(Target_EditorBuilder_a.java:83)

at ProgramsLanguage.editor.Target_Editor.createEditorCell(Target_Editor.java:12)

at jetbrains.mps.nodeEditor.cells.EditorCellFactoryImpl.createCell(EditorCellFactoryImpl.java:137)

at jetbrains.mps.nodeEditor.cells.EditorCellFactoryImpl.createEditorCell_internal(EditorCellFactoryImpl.java:103)

at jetbrains.mps.nodeEditor.cells.EditorCellFactoryImpl.createEditorCell(EditorCellFactoryImpl.java:90)

at jetbrains.mps.nodeEditor.EditorManager.createEditorCell_internal(EditorManager.java:371)

at jetbrains.mps.nodeEditor.EditorManager.createEditorCell(EditorManager.java:261)

at jetbrains.mps.nodeEditor.updater.UpdateSessionImpl.lambda$updateChildNodeCell$0(UpdateSessionImpl.java:211)

at jetbrains.mps.nodeEditor.updater.UpdateSessionImpl.runWithExplicitEditorHints(UpdateSessionImpl.java:333)

at jetbrains.mps.nodeEditor.updater.UpdateSessionImpl.updateChildNodeCell(UpdateSessionImpl.java:211)

at jetbrains.mps.nodeEditor.updater.UpdateSessionImpl.updateChildNodeCell(UpdateSessionImpl.java:200)

at ProgramsLanguage.editor.Program_EditorBuilder_a$mainTargetsListHandler_c7xntw_c5a.createNodeCell(Program_EditorBuilder_a.java:405)

at jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler.createInnerCells(AbstractCellListHandler.java:125)

at jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler.createCells(AbstractCellListHandler.java:105)

at jetbrains.mps.nodeEditor.cellProviders.AbstractCellListHandler.createCells(AbstractCellListHandler.java:88)

at ProgramsLanguage.editor.Program_EditorBuilder_a.createRefNodeList_0(Program_EditorBuilder_a.java:379)

at ProgramsLanguage.editor.Program_EditorBuilder_a.createCollection_5(Program_EditorBuilder_a.java:344)

at ProgramsLanguage.editor.Program_EditorBuilder_a.createCollection_0(Program_EditorBuilder_a.java:81)

at ProgramsLanguage.editor.Program_EditorBuilder_a.createCell(Program_EditorBuilder_a.java:68)

at ProgramsLanguage.editor.Program_Editor.createEditorCell(Program_Editor.java:12)

at jetbrains.mps.nodeEditor.cells.EditorCellFactoryImpl.createCell(EditorCellFactoryImpl.java:137)

at jetbrains.mps.nodeEditor.cells.EditorCellFactoryImpl.createEditorCell_internal(EditorCellFactoryImpl.java:103)

at jetbrains.mps.nodeEditor.cells.EditorCellFactoryImpl.createEditorCell(EditorCellFactoryImpl.java:90)

at jetbrains.mps.nodeEditor.EditorManager.createEditorCell_internal(EditorManager.java:371)

at jetbrains.mps.nodeEditor.EditorManager.createEditorCell(EditorManager.java:261)

at jetbrains.mps.nodeEditor.EditorManager.createRootCell(EditorManager.java:115)

at jetbrains.mps.nodeEditor.updater.UpdateSessionImpl.performUpdate(UpdateSessionImpl.java:157)

at jetbrains.mps.nodeEditor.updater.UpdaterImpl.lambda$updateRootCell$0(UpdaterImpl.java:134)

at jetbrains.mps.typechecking.backend.TypecheckingSessionHandler.computeWithSession(TypecheckingSessionHandler.java:61)

at jetbrains.mps.nodeEditor.updater.UpdaterImpl.updateRootCell(UpdaterImpl.java:134)

at jetbrains.mps.nodeEditor.updater.UpdaterImpl.doUpdate(UpdaterImpl.java:115)

at jetbrains.mps.nodeEditor.updater.UpdaterImpl.update(UpdaterImpl.java:91)

at jetbrains.mps.nodeEditor.EditorComponent.rebuildEditorContent(EditorComponent.java:1884)

at jetbrains.mps.nodeEditor.NodeEditorComponent.rebuildEditorContent(NodeEditorComponent.java:131)

at jetbrains.mps.nodeEditor.EditorComponent.lambda$new$1(EditorComponent.java:297)

at jetbrains.mps.smodel.ActionDispatcher.dispatch(ActionDispatcher.java:88)

at jetbrains.mps.smodel.ActionDispatcher.lambda$wrap$0(ActionDispatcher.java:110)

at jetbrains.mps.smodel.LockRunnable.run(LockRunnable.java:60)

at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:855)

at jetbrains.mps.smodel.WorkbenchModelAccess.tryRead(WorkbenchModelAccess.java:173)

at jetbrains.mps.smodel.WorkbenchModelAccess.lambda$runReadInEDT$1(WorkbenchModelAccess.java:130)

at jetbrains.mps.smodel.EDTExecutorInternal.tryToRunTopTask(EDTExecutorInternal.java:292)

at jetbrains.mps.smodel.EDTExecutorInternal.flushNTasks(EDTExecutorInternal.java:247)

at jetbrains.mps.smodel.EDTExecutorInternal.doFlush(EDTExecutorInternal.java:229)

at jetbrains.mps.smodel.EDTExecutorInternal.flushTasksQueue(EDTExecutorInternal.java:209)

at jetbrains.mps.smodel.EDTExecutorInternal.lambda$guaranteeWriteSafetyViaHack$3(EDTExecutorInternal.java:196)

at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:216)

at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:24)

at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:199)

at jetbrains.mps.smodel.EDTExecutorInternal.lambda$guaranteeWriteSafetyViaHack$4(EDTExecutorInternal.java:201)

at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)

at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:134)

at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)

at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:190)

at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)

at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)

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.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)

at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)

at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)

at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)

at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:762)

at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)

at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)

at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:501)

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.pumpEventsForFilter(EventDispatchThread.java:117)

at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)

at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)

at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)

at java.base/java.security.AccessController.doPrivileged(Native Method)

at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)

at java.desktop/java.awt.Dialog.show(Dialog.java:1063)

at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:694)

at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:435)

at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1715)

at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1674)

at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:90)

at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:55)

at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$initMacApplication$1(MacOSApplicationProvider.java:81)

at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$submit$8(MacOSApplicationProvider.java:181)

at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:216)

at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:24)

at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:199)

at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)

at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:324)

at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)

at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:134)

at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)

at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:190)

at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)

at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)

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.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)

at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)

at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)

at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)

at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)

at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)

at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)

at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:501)

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)

alexanderpann commented 4 months ago

Old JetBrains ticket about this issue: https://youtrack.jetbrains.com/issue/MPS-33889/Using-com.mbeddr.mpsutil.datepicker-does-not-work-when-look-and-feel-is-macOS-Light-problem-is-in-the-laf.xml-in-the-options