Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must not modify PSI inside save listener #53

Closed
MattGurney opened this issue Jul 13, 2016 · 50 comments
Closed

Must not modify PSI inside save listener #53

MattGurney opened this issue Jul 13, 2016 · 50 comments
Labels
Milestone

Comments

@MattGurney
Copy link

Getting the error "Must not modify PSI inside save listener" when saving a .java file.

IDEA: 2016.2
Save Actions: 0.11

Save Actions Settings:
image

@MattGurney
Copy link
Author

Stack Trace in IDE Fatal Errors Window:
Must not modify PSI inside save listener
com.intellij.util.IncorrectOperationException: Must not modify PSI inside save listener
at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:144)
at com.intellij.psi.impl.DocumentCommitThread$10.run(DocumentCommitThread.java:922)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.a(CodeStyleManagerImpl.java:676)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$$Lambda$1748/38333958.compute(Unknown Source)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:121)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.a(CodeStyleManagerImpl.java:705)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$$Lambda$1749/499752622.compute(Unknown Source)
at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:889)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:703)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:675)
at com.intellij.psi.impl.DocumentCommitThread.doActualPsiChange(DocumentCommitThread.java:907)
at com.intellij.psi.impl.DocumentCommitThread$9.process(DocumentCommitThread.java:825)
at com.intellij.psi.impl.DocumentCommitThread$9.process(DocumentCommitThread.java:805)
at com.intellij.psi.impl.PsiDocumentManagerBase.a(PsiDocumentManagerBase.java:379)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:355)
at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:142)
at com.intellij.psi.impl.PsiDocumentManagerBase$3.run(PsiDocumentManagerBase.java:314)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:318)
at com.intellij.psi.impl.DocumentCommitThread$7.run(DocumentCommitThread.java:636)
at com.intellij.psi.impl.DocumentCommitThread.commitSynchronously(DocumentCommitThread.java:505)
at com.intellij.psi.impl.PsiDocumentManagerBase$5.run(PsiDocumentManagerBase.java:435)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:905)
at com.intellij.psi.impl.PsiDocumentManagerBase.c(PsiDocumentManagerBase.java:448)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:300)
at com.intellij.codeInsight.actions.RearrangeCodeProcessor.a(RearrangeCodeProcessor.java:88)
at com.intellij.codeInsight.actions.RearrangeCodeProcessor$$Lambda$1890/869127413.call(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.openapi.command.WriteCommandAction$4.run(WriteCommandAction.java:185)
at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:167)
at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
at com.intellij.openapi.command.WriteCommandAction$2.run(WriteCommandAction.java:113)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:129)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:100)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:108)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:83)
at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:187)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:537)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask$$Lambda$1891/1764207983.run(Unknown Source)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:633)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:537)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask$$Lambda$1888/1442314620.accept(Unknown Source)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.e(AbstractLayoutCodeProcessor.java:529)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:507)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask$$Lambda$1887/1966580514.run(Unknown Source)
at com.intellij.openapi.project.DumbService.withAlternativeResolveEnabled(DumbService.java:256)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.iteration(AbstractLayoutCodeProcessor.java:507)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.b(AbstractLayoutCodeProcessor.java:362)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$$Lambda$1884/499851062.run(Unknown Source)
at com.intellij.openapi.progress.impl.CoreProgressManager$6.run(CoreProgressManager.java:256)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager$9.run(CoreProgressManager.java:384)
at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:494)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:155)
at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:534)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:396)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:76)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:259)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:211)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.a(AbstractLayoutCodeProcessor.java:358)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.run(AbstractLayoutCodeProcessor.java:254)
at com.dubreuia.processors.RearrangeCodeProcessor.writeToFile(RearrangeCodeProcessor.java:24)
at com.dubreuia.SaveActionManager.processPsiFile(SaveActionManager.java:57)
at com.dubreuia.SaveActionManager.beforeDocumentSaving(SaveActionManager.java:35)
at sun.reflect.GeneratedMethodAccessor627.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:377)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:364)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:343)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:226)
at com.sun.proxy.$Proxy22.beforeDocumentSaving(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:136)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.access$000(FileDocumentManagerImpl.java:86)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$1.invoke(FileDocumentManagerImpl.java:114)
at com.sun.proxy.$Proxy22.beforeDocumentSaving(Unknown Source)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.b(FileDocumentManagerImpl.java:421)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$$Lambda$1879/1251131375.run(Unknown Source)
at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:415)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:420)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:394)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:312)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:290)
at com.intellij.ide.SaveAndSyncHandlerImpl.doSaveDocumentsAndProjectsAndApp(SaveAndSyncHandlerImpl.java:131)
at com.intellij.ide.SaveAndSyncHandlerImpl.saveProjectsAndDocuments(SaveAndSyncHandlerImpl.java:125)
at com.intellij.ide.SaveAndSyncHandlerImpl$2.a(SaveAndSyncHandlerImpl.java:94)
at com.intellij.ide.SaveAndSyncHandlerImpl$2$$Lambda$720/908094152.run(Unknown Source)
at com.intellij.openapi.application.TransactionGuardImpl.a(TransactionGuardImpl.java:88)
at com.intellij.openapi.application.TransactionGuardImpl.access$300(TransactionGuardImpl.java:40)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:113)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:123)
at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:109)
at com.intellij.ide.SaveAndSyncHandlerImpl$2.onFrameDeactivated(SaveAndSyncHandlerImpl.java:92)
at com.intellij.ide.FrameStateManagerImpl.a(FrameStateManagerImpl.java:84)
at com.intellij.ide.FrameStateManagerImpl.access$500(FrameStateManagerImpl.java:32)
at com.intellij.ide.FrameStateManagerImpl$2.a(FrameStateManagerImpl.java:70)
at com.intellij.ide.FrameStateManagerImpl$2$$Lambda$719/580412295.run(Unknown Source)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:222)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:377)
at com.intellij.openapi.application.TransactionGuardImpl$6.run(TransactionGuardImpl.java:291)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:326)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:310)
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$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:863)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:699)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:385)
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)

@dubreuia
Copy link
Owner

Thank you for filling the issue. Does that happen often? Does the plugin still work?

Also can you post exact version (build # in Help > About)? I'll look into it.

@dubreuia dubreuia added the bug label Jul 13, 2016
@dubreuia dubreuia self-assigned this Jul 13, 2016
@MattGurney
Copy link
Author

Thanks for investigating.

I have only started using IntelliJ and save actions today, however I can see 3 instances of the error in the IntelliJ console log.

I think the plugin is working, not exactly sure, I will investigate further the next time it happens.

Exact version information:
IntelliJ IDEA 2016.2
Build #IU-162.1121.32, built on July 9, 2016
Licensed to***************************
Subscription is active until July 6, 2017
JRE: 1.8.0_45-b15 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

@marcbr8
Copy link

marcbr8 commented Jul 13, 2016

Having this problem since I installed the new version of IntelliJ IDEA: 2016.2Build #IU-162.1121.32

@daggertheog
Copy link

daggertheog commented Jul 13, 2016

Same issue after the latest IntelliJ update. Looks like the plugin does something (e.g. reformats the code and rearranges methods), but causes an exception to be thrown too. :)

http://pastebin.com/ku5340sk

@PierreAdam
Copy link

PierreAdam commented Jul 14, 2016

I also got that issue since the last update of IntelliJ. I don't have issue saving but I get that error when I create new file.

Here's my settings :
image

@dubreuia
Copy link
Owner

The processors are independent (reformat, quick fixes, rearrange, etc.) and it seems it's only the rearrange processor that crashes (the others are finishing).

I'll check it out

@marcbr8
Copy link

marcbr8 commented Jul 20, 2016

Keep having this problem. Especially when creating a new file

@greenkiwi
Copy link

I'm getting it when it would appear to be making fields final.

It happens sometimes.

Attempt to modify PSI for non-committed Document!
java.lang.IllegalStateException: Attempt to modify PSI for non-committed Document!
    at com.siyeh.ig.fixes.MakeFieldFinalFix.doFix(MakeFieldFinalFix.java:88)
    at com.siyeh.ig.InspectionGadgetsFix.applyFix(InspectionGadgetsFix.java:43)
    at com.siyeh.ig.InspectionGadgetsFix.applyFix(InspectionGadgetsFix.java:27)
    at com.dubreuia.processors.InspectionProcessor$InspectionWriteQuickFixesAction.writeQuickFixes(InspectionProcessor.java:82)
    at com.dubreuia.processors.InspectionProcessor$InspectionWriteQuickFixesAction.run(InspectionProcessor.java:74)

IntelliJ IDEA 2016.2
Build #IU-162.1121.32, built on July 9, 2016
Licensed to RelayRides / Adam
You have perpetual fallback license for this version
Subscription is active until January 4, 2018
JRE: 1.8.0_76-release-b216 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

@abd3lraouf
Copy link

When creating new class :

capture

IDE version :
screenshot 1

@SemionPar
Copy link

In my case it also happens when I am creating a new class. Class is created with double package declaration (one after another), after that IDE becomes unstable (e.g. weird syntax highlighting bug).
stacktrace.txt
save_actions_settings
intellij_idea

@abd3lraouf
Copy link

abd3lraouf commented Jul 23, 2016

@dubreuia Listen to this :
I've reported that the plugin is problematic as I posted above
Today I've updated JDK to 1.8.0_102 and updated Intelljidea to Ultimate of 2016.2 (my community edition 2016.2 is still installed)

and the problem had disappeared on both version Ultimate and Community.

Ultimate is of version :
screenshot 4

Community version :
screenshot 3

@MALPI
Copy link

MALPI commented Jul 26, 2016

Also having the issue on saving and creating new files. This basically makes the plugin unusable for me...

@dubreuia
Copy link
Owner

@AbdElraoufSabri Happy to hear that it disappeared, might be your java version... Are you sure it's not your configuration? It looks like the problem only happens if you have the "rearrange code" option activated.

@MALPI An easy workaround is to deactivate "rearrange code", the rest of the plugin should still work.

I'll check out this issue ASAP.

@abd3lraouf
Copy link

@dubreuia Actually the problem happened again but you were right, once I disabled rearrange code the problem disappeared

@JonathanBrouwer
Copy link

JonathanBrouwer commented Aug 3, 2016

I got the same problem, but rearrange code is one of the reasons why I use this plugin so I would like to see a fix for this.

Error: http://pastebin.com/Xr6R5VFF

@dubreuia
Copy link
Owner

dubreuia commented Aug 4, 2016

I need to find time for this one, I didn't expect Jetbrains would break the plugin.

Don't hesitate if you can submit a pull request.

@junje
Copy link

junje commented Sep 13, 2016

my plugin version is 0.12,idea version is 2.4. the plugin still work.but the error is very geeky
qq 20160913103141

@petromir
Copy link

Same as @junje

@jrd
Copy link

jrd commented Jan 13, 2017

Same here, only sometimes. I use your plugin for about 2 years. I use rearrange option.

IntelliJ IDEA (Community Edition) 2017.1 EAP
Build #IC-171.2272.14, built on January 12, 2017
JRE: 1.8.0_72-b15 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

Plugin version : 0.12

@dkudinskas
Copy link

I also hit this rather frequently by now.

Not using code rearrange, what I have enabled:
Organize imports
Qualify field access with this
Remove unnecessary semicolon
Add missing @OverRide notations

@dubreuia
Copy link
Owner

I still can't reproduce this one. Can you post a full text stack trace @gendalfas? (or anybody else)

I'd prefer understanding why this happens than putting a big try / catch

@dkudinskas
Copy link

Will do so once back at work. I have noticed that the stack traces actually differ somewhat midway, so that actually might be of help finding the actual cause.

@dubreuia
Copy link
Owner

There's a possible solution in #40

@dubreuia dubreuia removed their assignment Feb 10, 2017
@dubreuia dubreuia added this to the next milestone Feb 10, 2017
@alexdrean
Copy link

alexdrean commented May 18, 2017

Still the same problem, very annoying when this happens (and auto reformatting is the reason I am using SaveActions).
(Merci pour LesFurets.com, je gagne 300€/an grâce à vous ! ;-))
Must not modify PSI inside save listener com.intellij.util.IncorrectOperationException: Must not modify PSI inside save listener at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:146) at com.intellij.psi.impl.DocumentCommitThread.lambda$doActualPsiChange$8(DocumentCommitThread.java:868) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$5(CodeStyleManagerImpl.java:675) at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:121) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$7(CodeStyleManagerImpl.java:704) at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:888) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:702) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:674) at com.intellij.psi.impl.DocumentCommitThread.doActualPsiChange(DocumentCommitThread.java:855) at com.intellij.psi.impl.DocumentCommitThread.lambda$doCommit$7(DocumentCommitThread.java:774) at com.intellij.psi.impl.PsiDocumentManagerBase.commitToExistingPsi(PsiDocumentManagerBase.java:400) at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:376) at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:142) at com.intellij.psi.impl.PsiDocumentManagerBase$3.run(PsiDocumentManagerBase.java:334) at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:338) at com.intellij.psi.impl.DocumentCommitThread.lambda$createEdtRunnable$5(DocumentCommitThread.java:592) at com.intellij.psi.impl.DocumentCommitThread.commitSynchronously(DocumentCommitThread.java:457) at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$doCommit$0(PsiDocumentManagerBase.java:454) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023) at com.intellij.psi.impl.PsiDocumentManagerBase.doCommit(PsiDocumentManagerBase.java:466) at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:314) at com.intellij.codeInsight.actions.RearrangeCodeProcessor.lambda$prepareTask$0(RearrangeCodeProcessor.java:88) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:252) at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:234) at com.intellij.openapi.application.RunResult.run(RunResult.java:35) at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:171) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023) at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:170) at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:210) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:149) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:119) at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:212) at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:168) at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:151) at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:254) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.lambda$performFileProcessing$3(AbstractLayoutCodeProcessor.java:551) at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:672) at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:685) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.performFileProcessing(AbstractLayoutCodeProcessor.java:551) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.lambda$iteration$0(AbstractLayoutCodeProcessor.java:524) at com.intellij.openapi.project.DumbService.withAlternativeResolveEnabled(DumbService.java:277) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.iteration(AbstractLayoutCodeProcessor.java:524) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.lambda$runProcessFiles$4(AbstractLayoutCodeProcessor.java:378) at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:267) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726) at com.intellij.openapi.progress.impl.CoreProgressManager$6.run(CoreProgressManager.java:410) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163) at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:573) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:422) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:89) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:270) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:222) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.runProcessFiles(AbstractLayoutCodeProcessor.java:374) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.run(AbstractLayoutCodeProcessor.java:264) at com.dubreuia.processors.RearrangeCodeProcessor.writeToFile(RearrangeCodeProcessor.java:24) at com.dubreuia.SaveActionManager.processPsiFile(SaveActionManager.java:60) at com.dubreuia.SaveActionManager.beforeDocumentSaving(SaveActionManager.java:35) at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117) at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:437) at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:398) at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:387) at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:373) at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44) at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:230) at com.sun.proxy.$Proxy21.beforeDocumentSaving(Unknown Source) at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.multiCast(FileDocumentManagerImpl.java:153) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$new$0(FileDocumentManagerImpl.java:132) at com.sun.proxy.$Proxy21.beforeDocumentSaving(Unknown Source) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocumentInWriteAction$4(FileDocumentManagerImpl.java:418) at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:411) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocumentInWriteAction(FileDocumentManagerImpl.java:417) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocument$2(FileDocumentManagerImpl.java:390) at com.intellij.openapi.application.WriteAction.run(WriteAction.java:91) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocument(FileDocumentManagerImpl.java:390) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:312) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:290) at com.intellij.openapi.application.impl.ApplicationImpl.saveAll(ApplicationImpl.java:1442) at com.intellij.ide.actions.SaveAllAction.actionPerformed(SaveAllAction.java:36) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:215) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:232) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:570) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$2(IdeKeyEventDispatcher.java:619) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:618) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:477) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:633) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365) 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)

@dubreuia
Copy link
Owner

I'm trying a fix in version 0.15 that I'll release this weekend. Can't reproduce so I hope it works.

@BullCheat Cool d'avoir un bon feedback sur note site :-). Check notre blog tech et notre github si ça t'intéresse https://github.com/lesfurets / https://beastie.lesfurets.com/

@dubreuia
Copy link
Owner

https://media.giphy.com/media/niEnUBEHbY448/giphy.gif?response_id=5925df761649a9c40ca12ecd

        private void writeQuickFixes(final ProblemDescriptor problemDescriptor, QuickFix[] fixes) {
            for (final QuickFix fix : fixes) {
                if (fix != null) {
                    ApplicationManager.getApplication().invokeLater(new Runnable() {
                        @Override
                        public void run() {
                            CommandProcessor.getInstance().executeCommand(project, new Runnable() {
                                @Override
                                public void run() {
                                    ApplicationManager.getApplication().runWriteAction(new Runnable() {
                                        @Override
                                        public void run() {
                                            fix.applyFix(project, problemDescriptor);
                                        }
                                    });
                                }
                            }, null, null);
                        }
                    }, project.getDisposed());
                }
            }
        }

(yes it works)

@burgerkingeater
Copy link

burgerkingeater commented May 26, 2017

@dubreuia I'm also having this issue, so there will be a possible fix for it on version 0.15 being released on this weekend?

@dubreuia
Copy link
Owner

I'm testing it right now I should be able to release it today.

The problem is: I can't reproduce so I'm just hoping I'm fixing the problem.

@dubreuia
Copy link
Owner

dubreuia commented Jun 1, 2017

Not fixed

@dubreuia dubreuia reopened this Jun 1, 2017
@MartinX3
Copy link

MartinX3 commented Jun 1, 2017

I can confirm.
I have this problem, since I'm using this addon.
(Since several versions of this plugin and of idea ultimate 2017.x.x)
And it isn't realy reproductable, it happens randomly.

@zendu
Copy link

zendu commented Jun 1, 2017

Crashes frequently for me.

IntelliJ IDEA 2017.1.3
Build #IU-171.4424.56, built on May 12, 2017
JRE: 1.8.0_112-release-736-b21 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

Must not modify PSI inside save listener
com.intellij.util.IncorrectOperationException: Must not modify PSI inside save listener
at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:146)
at com.intellij.psi.impl.DocumentCommitThread.lambda$doActualPsiChange$8(DocumentCommitThread.java:868)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$5(CodeStyleManagerImpl.java:675)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:121)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$7(CodeStyleManagerImpl.java:704)
at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:888)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:702)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:674)
at com.intellij.psi.impl.DocumentCommitThread.doActualPsiChange(DocumentCommitThread.java:855)
at com.intellij.psi.impl.DocumentCommitThread.lambda$doCommit$7(DocumentCommitThread.java:774)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitToExistingPsi(PsiDocumentManagerBase.java:400)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:376)
at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:142)
at com.intellij.psi.impl.PsiDocumentManagerBase$3.run(PsiDocumentManagerBase.java:334)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:338)
at com.intellij.psi.impl.DocumentCommitThread.lambda$createEdtRunnable$5(DocumentCommitThread.java:592)
at com.intellij.psi.impl.DocumentCommitThread.commitSynchronously(DocumentCommitThread.java:457)
at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$doCommit$0(PsiDocumentManagerBase.java:454)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023)
at com.intellij.psi.impl.PsiDocumentManagerBase.doCommit(PsiDocumentManagerBase.java:466)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:314)
at com.intellij.codeInsight.actions.RearrangeCodeProcessor.a(RearrangeCodeProcessor.java:88)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:252)
at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:234)
at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:171)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023)
at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:170)
at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:210)
at com.intellij.openapi.command.impl.CoreCommandProcessor.a(CoreCommandProcessor.java:149)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:119)
at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:212)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:168)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:151)
at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:254)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:551)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:672)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:685)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:551)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.b(AbstractLayoutCodeProcessor.java:524)
at com.intellij.openapi.project.DumbService.withAlternativeResolveEnabled(DumbService.java:277)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.iteration(AbstractLayoutCodeProcessor.java:524)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.b(AbstractLayoutCodeProcessor.java:378)
at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:267)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
at com.intellij.openapi.progress.impl.CoreProgressManager$6.run(CoreProgressManager.java:410)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:573)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:422)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:89)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:270)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:222)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.a(AbstractLayoutCodeProcessor.java:374)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.run(AbstractLayoutCodeProcessor.java:264)
at com.dubreuia.processors.RearrangeCodeProcessor.writeToFile(RearrangeCodeProcessor.java:24)
at com.dubreuia.SaveActionManager.processPsiFile(SaveActionManager.java:60)
at com.dubreuia.SaveActionManager.beforeDocumentSaving(SaveActionManager.java:35)
at sun.reflect.GeneratedMethodAccessor183.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:437)
at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:398)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:387)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:373)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:230)
at com.sun.proxy.$Proxy23.beforeDocumentSaving(Unknown Source)
at sun.reflect.GeneratedMethodAccessor183.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:153)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:132)
at com.sun.proxy.$Proxy23.beforeDocumentSaving(Unknown Source)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:418)
at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:411)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.e(FileDocumentManagerImpl.java:417)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.b(FileDocumentManagerImpl.java:390)
at com.intellij.openapi.application.WriteAction.run(WriteAction.java:91)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:390)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:312)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:290)
at com.intellij.openapi.application.impl.ApplicationImpl.saveAll(ApplicationImpl.java:1442)
at com.intellij.ide.actions.SaveAllAction.actionPerformed(SaveAllAction.java:36)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:215)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:232)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:570)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:619)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:618)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.f(IdeKeyEventDispatcher.java:477)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:633)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
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)

@dubreuia
Copy link
Owner

@charlouze
Copy link

You should probable reopen as i still have the issue.
Here are my intellij about:
IntelliJ IDEA 2017.2.1
Build #IU-172.3544.35, built on July 31, 2017
JRE: 1.8.0_152-release-915-b6 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.10.0-30-generic

ans here is the stack:
Must not modify PSI inside save listener com.intellij.util.IncorrectOperationException: Must not modify PSI inside save listener at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:146) at com.intellij.psi.impl.DocumentCommitThread.lambda$doActualPsiChange$8(DocumentCommitThread.java:868) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$5(CodeStyleManagerImpl.java:676) at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:116) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$7(CodeStyleManagerImpl.java:705) at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:903) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:703) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:675) at com.intellij.psi.impl.DocumentCommitThread.doActualPsiChange(DocumentCommitThread.java:855) at com.intellij.psi.impl.DocumentCommitThread.lambda$doCommit$7(DocumentCommitThread.java:774) at com.intellij.psi.impl.PsiDocumentManagerBase.commitToExistingPsi(PsiDocumentManagerBase.java:399) at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:375) at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:145) at com.intellij.psi.impl.PsiDocumentManagerBase$3.run(PsiDocumentManagerBase.java:333) at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:337) at com.intellij.psi.impl.DocumentCommitThread.lambda$createEdtRunnable$5(DocumentCommitThread.java:592) at com.intellij.psi.impl.DocumentCommitThread.commitSynchronously(DocumentCommitThread.java:457) at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$doCommit$0(PsiDocumentManagerBase.java:453) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1031) at com.intellij.psi.impl.PsiDocumentManagerBase.doCommit(PsiDocumentManagerBase.java:465) at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:313) at com.intellij.codeInsight.actions.RearrangeCodeProcessor.a(RearrangeCodeProcessor.java:90) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:252) at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:234) at com.intellij.openapi.application.RunResult.run(RunResult.java:35) at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:171) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1031) at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:170) at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:210) at com.intellij.openapi.command.impl.CoreCommandProcessor.a(CoreCommandProcessor.java:149) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:119) at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:212) at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:168) at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:151) at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:254) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:551) at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:681) at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:694) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:551) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.e(AbstractLayoutCodeProcessor.java:524) at com.intellij.openapi.project.DumbService.withAlternativeResolveEnabled(DumbService.java:278) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.iteration(AbstractLayoutCodeProcessor.java:524) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.a(AbstractLayoutCodeProcessor.java:378) at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:261) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:718) at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:402) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:170) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:548) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157) at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:582) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:414) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:117) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:264) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:216) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.b(AbstractLayoutCodeProcessor.java:374) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.run(AbstractLayoutCodeProcessor.java:264) at com.dubreuia.processors.RearrangeCodeProcessor.writeToFile(RearrangeCodeProcessor.java:28) at com.dubreuia.core.SaveActionManager.processPsiFile(SaveActionManager.java:84) at com.dubreuia.core.SaveActionManager.beforeDocumentSaving(SaveActionManager.java:38) at sun.reflect.GeneratedMethodAccessor320.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117) at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:443) at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:404) at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:393) at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:374) at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:45) at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:231) at com.sun.proxy.$Proxy22.beforeDocumentSaving(Unknown Source) at sun.reflect.GeneratedMethodAccessor320.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:153) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:132) at com.sun.proxy.$Proxy22.beforeDocumentSaving(Unknown Source) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.e(FileDocumentManagerImpl.java:428) at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:411) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:427) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.d(FileDocumentManagerImpl.java:390) at com.intellij.openapi.application.WriteAction.run(WriteAction.java:91) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:390) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:312) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:290) at com.intellij.openapi.application.impl.ApplicationImpl.saveAll(ApplicationImpl.java:1450) at com.intellij.ide.actions.SaveAllAction.actionPerformed(SaveAllAction.java:36) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:216) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:233) 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:193) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:624) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.f(IdeKeyEventDispatcher.java:479) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:213) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:621) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365) 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)

@dubreuia
Copy link
Owner

dubreuia commented Aug 9, 2017

This issue will haunt me forever

@dubreuia dubreuia reopened this Aug 9, 2017
@abd3lraouf
Copy link

@charlouze What plugin version you used?

@charlouze
Copy link

@AbdElraoufSabri The very last one ! (0.18)

@MartinX3
Copy link

@UnconventionalMindset
Copy link

Hey @dubreuia unfortunately I am not able to reproduce the issue but I remember how I got mine:

  1. I started editing a java class by writing: "lo".
  2. The autocomplete popup appear
  3. I click on firefox (then Intellij loses focus and my guess is that it also saves the file).
  4. I get the error with stacktrace.

IntelliJ IDEA 2017.2.2
Build #IU-172.3757.52, built on August 15, 2017
JRE: 1.8.0_152-release-915-b10 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.10.0-33-generic
I'm using Ubuntu Gnome 17.04

@MattGurney
Copy link
Author

Hi @dubreuia,

IntelliJ IDEA 2017.2.2
Build #IU-172.3757.52, built on August 15, 2017
Licensed to AMP / Matthew Gurney
Subscription is active until July 6, 2018
JRE: 1.8.0_112-release-287-b2 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1

IDEA Project uses springboot, lombok, gradle etc...

I appear to be able to re-create the issue any time.

  1. In IDEA, File -> Settings -> Save Actions
  2. Under "Formatting actions" tick/enable "Rearrange fields and methods blah blah"
  3. Open a java file
  4. Move a field declaration below a method declaration
  5. Save the file
  6. Get error below:

Must not modify PSI inside save listener com.intellij.util.IncorrectOperationException: Must not modify PSI inside save listener at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:146) at com.intellij.psi.impl.DocumentCommitThread.lambda$doActualPsiChange$8(DocumentCommitThread.java:868) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$5(CodeStyleManagerImpl.java:676) at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:116) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.lambda$performActionWithFormatterDisabled$7(CodeStyleManagerImpl.java:705) at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:903) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:703) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:675) at com.intellij.psi.impl.DocumentCommitThread.doActualPsiChange(DocumentCommitThread.java:855) at com.intellij.psi.impl.DocumentCommitThread.lambda$doCommit$7(DocumentCommitThread.java:774) at com.intellij.psi.impl.PsiDocumentManagerBase.commitToExistingPsi(PsiDocumentManagerBase.java:399) at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:375) at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:145) at com.intellij.psi.impl.PsiDocumentManagerBase$3.run(PsiDocumentManagerBase.java:333) at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:337) at com.intellij.psi.impl.DocumentCommitThread.lambda$createEdtRunnable$5(DocumentCommitThread.java:592) at com.intellij.psi.impl.DocumentCommitThread.commitSynchronously(DocumentCommitThread.java:457) at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$doCommit$0(PsiDocumentManagerBase.java:453) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1031) at com.intellij.psi.impl.PsiDocumentManagerBase.doCommit(PsiDocumentManagerBase.java:465) at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:313) at com.intellij.codeInsight.actions.RearrangeCodeProcessor.a(RearrangeCodeProcessor.java:96) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:252) at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:234) at com.intellij.openapi.application.RunResult.run(RunResult.java:35) at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:171) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1031) at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:170) at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:210) at com.intellij.openapi.command.impl.CoreCommandProcessor.a(CoreCommandProcessor.java:149) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:119) at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:212) at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:168) at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:151) at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:254) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:551) at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:681) at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:694) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.e(AbstractLayoutCodeProcessor.java:551) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.d(AbstractLayoutCodeProcessor.java:524) at com.intellij.openapi.project.DumbService.withAlternativeResolveEnabled(DumbService.java:278) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.iteration(AbstractLayoutCodeProcessor.java:524) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.a(AbstractLayoutCodeProcessor.java:378) at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:261) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:718) at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:402) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:170) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:548) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157) at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:582) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:414) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:117) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:264) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:216) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.b(AbstractLayoutCodeProcessor.java:374) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.run(AbstractLayoutCodeProcessor.java:264) at com.dubreuia.processors.RearrangeCodeProcessor.writeToFile(RearrangeCodeProcessor.java:28) at com.dubreuia.core.SaveActionManager.processPsiFile(SaveActionManager.java:84) at com.dubreuia.core.SaveActionManager.beforeDocumentSaving(SaveActionManager.java:38) at sun.reflect.GeneratedMethodAccessor901.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117) at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:443) at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:404) at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:393) at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:372) at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:45) at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:231) at com.sun.proxy.$Proxy43.progressWindowCreated(Unknown Source) at com.intellij.openapi.progress.util.ProgressWindow.<init>(ProgressWindow.java:122) at com.intellij.openapi.progress.util.ProgressWindow.<init>(ProgressWindow.java:84) at com.intellij.openapi.progress.util.ProgressWindow.<init>(ProgressWindow.java:80) at com.intellij.openapi.progress.util.ProgressWindow.<init>(ProgressWindow.java:76) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.a(AbstractLayoutCodeProcessor.java:400) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.b(AbstractLayoutCodeProcessor.java:358) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor.run(AbstractLayoutCodeProcessor.java:252) at com.dubreuia.processors.OptimizeImportsProcessor.writeToFile(OptimizeImportsProcessor.java:28) at com.dubreuia.core.SaveActionManager.processPsiFile(SaveActionManager.java:84) at com.dubreuia.core.SaveActionManager.beforeDocumentSaving(SaveActionManager.java:38) at sun.reflect.GeneratedMethodAccessor901.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117) at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:443) at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:404) at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:393) at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:374) at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:45) at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:231) at com.sun.proxy.$Proxy22.beforeDocumentSaving(Unknown Source) at sun.reflect.GeneratedMethodAccessor901.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:153) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:132) at com.sun.proxy.$Proxy22.beforeDocumentSaving(Unknown Source) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.b(FileDocumentManagerImpl.java:428) at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:411) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.d(FileDocumentManagerImpl.java:427) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.c(FileDocumentManagerImpl.java:390) at com.intellij.openapi.application.WriteAction.run(WriteAction.java:91) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:390) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:312) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:290) at com.intellij.openapi.application.impl.ApplicationImpl.saveAll(ApplicationImpl.java:1450) at com.intellij.ide.actions.SaveAllAction.actionPerformed(SaveAllAction.java:36) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:216) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:233) 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:193) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:624) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:479) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:213) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:621) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365) 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)

@dubreuia
Copy link
Owner

I've corrected the problem, attached 0.20-RC should fix it. I'll test it a bit before releasing (if someone could help I'd appreciate that).

save-actions_0.20-RC.jar.zip

@adetalhouet
Copy link

adetalhouet commented Aug 31, 2017

Tested on a couple of classes, seems to fix the issue. Can't reproduce using @MattGurneyAMP steps.

+1 LGTM

IntelliJ IDEA 2017.2
Build #IC-172.3317.76, built on July 15, 2017
JRE: 1.8.0_152-release-915-b5 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.4

@dubreuia
Copy link
Owner

dubreuia commented Sep 1, 2017

Released v0.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests