Getting "cannot share data context between Swing events" randomly

For a plugin, I have implemented a JDialog where I have added ok, cancel buttons and a checkbox. "cancel" is the default button selected. When I reach to Ok button through tab and then I press enter then ok action gets executed but on random basis, I get below exceptions:

cannot share data context between Swing events; initial event count = 202151; current event count = 202334

java.lang.Throwable
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:113)
 at com.intellij.ide.impl.DataManagerImpl$MyDataContext.getData(DataManagerImpl.java:344)
 at com.intellij.openapi.actionSystem.AnActionEvent$1.getData(AnActionEvent.java:131)
 at com.intellij.openapi.actionSystem.DataKey.getData(DataKey.java:75)
 at com.intellij.openapi.editor.actions.TabAction$Handler.executeWriteAction(TabAction.java:63)
 at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:64)
 at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:984)
 at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:47)
 at com.intellij.openapi.editor.actionSystem.EditorActionHandler$1.perform(EditorActionHandler.java:120)
 at com.intellij.openapi.editor.impl.CaretModelImpl$3.run(CaretModelImpl.java:355)
 at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:426)
 at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:349)
 at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:117)
 at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:83)
 at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:124)
 at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:94)
 at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:68)
 at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:564)
 at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:611)
 at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:463)
 at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:206)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:493)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)



Could you please suggest what can be done to resolve this.
1 comment
Comment actions Permalink

In addition to above, now I again similar error but while copy pasting:


cannot share data context between Swing events; initial event count = 1960477; current event count = 1960555
java.lang.Throwable
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:113)
 at com.intellij.ide.impl.DataManagerImpl$MyDataContext.getData(DataManagerImpl.java:344)
 at com.intellij.openapi.actionSystem.DataKey.getData(DataKey.java:75)
 at com.intellij.ide.actions.PasteReferenceProvider.isPasteEnabled(PasteReferenceProvider.java:74)
 at com.intellij.codeInsight.editorActions.PasteHandler.execute(PasteHandler.java:111)
 at com.intellij.codeInsight.editorActions.PasteHandler.execute(PasteHandler.java:69)
 at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doExecute(EditorActionHandler.java:93)
 at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:125)
 at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:83)
 at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:124)
 at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:94)
 at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:68)
 at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:564)
 at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:611)
 at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:463)
 at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:206)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:493)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

0

Please sign in to leave a comment.