kstenschke / shifter-plugin

Intelligent string/code manipulation plugin for Jetbrains IDEs: Detects shiftable type of word/line/selection and manipulates it on keyboard shortcut
http://plugins.jetbrains.com/plugin/6149
Apache License 2.0
105 stars 13 forks source link

Exception thrown when shifting numeric block selection #40

Closed KableM closed 5 years ago

KableM commented 6 years ago

Exception is benign, the operation still works fine other than causing the "IDE Error Occured" bubble to pop up.

System/IDE:

IntelliJ IDEA 2017.3.4 (Ultimate Edition)
Build #IU-173.4548.28, built on January 30, 2018
JRE: 1.8.0_152-release-1024-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6

Exception:

AWT events are not allowed inside write action: sun.awt.PeerEvent[INVOCATION_DEFAULT,runnable=sun.lwawt.LWCursorManager$1@544a7e28,notifier=null,catchExceptions=false,when=1518764763182] on frame0
java.lang.Throwable: AWT events are not allowed inside write action: sun.awt.PeerEvent[INVOCATION_DEFAULT,runnable=sun.lwawt.LWCursorManager$1@544a7e28,notifier=null,catchExceptions=false,when=1518764763182] on frame0
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:136)
    at com.intellij.openapi.application.impl.NoSwingUnderWriteAction.a(NoSwingUnderWriteAction.java:36)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:377)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.awt.Dialog.show(Dialog.java:1084)
    at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:869)
    at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:795)
    at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:757)
    at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:718)
    at com.kstenschke.shifter.models.ShiftableSelection.sortLinesInDocument(ShiftableSelection.java:263)
    at com.kstenschke.shifter.models.ShiftableSelectionWithPopup.sortLinesOrSwapQuotesInDocument(ShiftableSelectionWithPopup.java:155)
    at com.kstenschke.shifter.models.ShiftableSelection.shiftSelectionInDocument(ShiftableSelection.java:120)
    at com.kstenschke.shifter.actions.ActionsPerformer.shiftSelection(ActionsPerformer.java:91)
    at com.kstenschke.shifter.actions.ActionsPerformer.write(ActionsPerformer.java:61)
    at com.kstenschke.shifter.actions.ShiftUpAction$1$1.run(ShiftUpAction.java:55)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1003)
    at com.kstenschke.shifter.actions.ShiftUpAction$1.run(ShiftUpAction.java:52)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.a(CoreCommandProcessor.java:149)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:109)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
    at com.kstenschke.shifter.actions.ShiftUpAction.actionPerformed(ShiftUpAction.java:49)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:576)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:625)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:624)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.e(IdeKeyEventDispatcher.java:479)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:213)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:622)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
duponter commented 6 years ago

A similar exception occurs when selecting multiple numbers (shiftNumericalBlockSelectionInDocument) and shift up. The 'Shift Numeric Block Selection' pops up but an IDE error is also logged. However, you still can make your choice and the actual operation proceeds without any problems.

System/IDE:

IntelliJ IDEA 2018.2.1 (Ultimate Edition)
Build #IU-182.3911.36, built on August 6, 2018
JRE: 1.8.0_152-release-1248-b8 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6

StackTrace:

java.lang.Throwable: AWT events are not allowed inside write action: sun.awt.PeerEvent[INVOCATION_DEFAULT,runnable=sun.lwawt.LWCursorManager$1@57a0d7fe,notifier=null,catchExceptions=false,when=1533803615471] on frame1
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123)
    at com.intellij.openapi.application.impl.NoSwingUnderWriteAction.lambda$watchForEvents$0(NoSwingUnderWriteAction.java:36)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:393)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.awt.Dialog.show(Dialog.java:1077)
    at java.awt.Component.show(Component.java:1685)
    at java.awt.Component.setVisible(Component.java:1637)
    at java.awt.Window.setVisible(Window.java:1014)
    at java.awt.Dialog.setVisible(Dialog.java:998)
    at com.kstenschke.shifter.utils.UtilsEnvironment.setDialogVisible(UtilsEnvironment.java:109)
    at com.kstenschke.shifter.models.ShiftableBlockSelection.shiftNumericalBlockSelectionInDocument(ShiftableBlockSelection.java:130)
    at com.kstenschke.shifter.models.ShiftableBlockSelection.shiftBlockSelectionInDocument(ShiftableBlockSelection.java:91)
    at com.kstenschke.shifter.actions.ActionsPerformer.shiftSelection(ActionsPerformer.java:86)
    at com.kstenschke.shifter.actions.ActionsPerformer.write(ActionsPerformer.java:61)
    at com.kstenschke.shifter.actions.ShiftUpAction$1$1.run(ShiftUpAction.java:55)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1038)
    at com.kstenschke.shifter.actions.ShiftUpAction$1.run(ShiftUpAction.java:52)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:139)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:97)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:87)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:73)
    at com.kstenschke.shifter.actions.ShiftUpAction.actionPerformed(ShiftUpAction.java:49)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:620)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$2(IdeKeyEventDispatcher.java:669)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:668)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:520)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:475)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:212)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
kstenschke commented 5 years ago

Issue should be resolved with d03ba831a44f9f01c60d1ae064ed2be809f36b16, (coming with release 1.8.0)