dkandalov / limited-wip

IntelliJ plugin to limit your work-in-progress
https://plugins.jetbrains.com/plugin/7655
111 stars 7 forks source link

Write access is allowed from write-safe contexts only. #7

Closed dkandalov closed 6 years ago

dkandalov commented 7 years ago

I ran into an error. I let the time get to 5 minutes to do a revert. The code disappeared and then PHP Storm popped up an error. I'm including it below.

Error: Write access is allowed from write-safe contexts only. Please ensure you're using invokeLater/invokeAndWait with a correct modality state (not "any"). See TransactionGuard documentation for details.

Details:

Write access is allowed from write-safe contexts only. Please ensure you're using invokeLater/invokeAndWait with a correct modality state (not "any"). See TransactionGuard documentation for details.
  current modality=ModalityState.NON_MODAL
  known modalities={ModalityState.NON_MODAL=true, ModalityState.NON_MODAL=true}
java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:132)
    at com.intellij.openapi.application.TransactionGuardImpl.assertWriteActionAllowed(TransactionGuardImpl.java:246)
    at com.intellij.openapi.editor.impl.DocumentImpl.c(DocumentImpl.java:619)
    at com.intellij.openapi.editor.impl.DocumentImpl.a(DocumentImpl.java:548)
    at com.intellij.openapi.editor.impl.DocumentImpl.replaceText(DocumentImpl.java:455)
    at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$2.run(FileDocumentManagerImpl.java:634)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:934)
    at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:620)
    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.fileEditor.impl.FileDocumentManagerImpl.reloadFromDisk(FileDocumentManagerImpl.java:620)
    at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.reloadFiles(FileDocumentManagerImpl.java:512)
    at limitedwip.autorevert.components.IdeAdapter$2.run(IdeAdapter.java:68)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:934)
    at limitedwip.autorevert.components.IdeAdapter.revertCurrentChangeList(IdeAdapter.java:53)
    at limitedwip.autorevert.AutoRevert.onTimer(AutoRevert.java:69)
    at limitedwip.autorevert.components.AutoRevertComponent$1$1.run(AutoRevertComponent.java:31)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:417)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:401)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at com.intellij.ide.IdeEventQueue.g(IdeEventQueue.java:843)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:679)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
    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)
dkandalov commented 6 years ago

Should be fixed in revision 0db4429a