From 822a847fba6ce495e6a373b374d55bfad545f8bc Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sun, 21 Jun 2015 17:49:51 +0300 Subject: [PATCH] PatchApplier: no need in invokeLater: the method is called from EDT, and not from the write action So the change which introduced invokeLater here is no more valid. --- .../diff/impl/patch/formove/PatchApplier.java | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java index 9fa2692129c0..01cf402f6ade 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java @@ -245,6 +245,7 @@ public class PatchApplier { context.next(createApplyPart(showSuccessNotification, silentAddDelete)); } + @CalledInAwt public static ApplyPatchStatus executePatchGroup(final Collection group, final LocalChangeList localChangeList) { if (group.isEmpty()) return ApplyPatchStatus.SUCCESS; //? final Project project = group.iterator().next().myProject; @@ -345,6 +346,7 @@ public class PatchApplier { } } + @CalledInAwt protected void refreshFiles(final Collection additionalDirectly, @Nullable final ContinuationContext context) { final List directlyAffected = myVerifier.getDirectlyAffected(); final List indirectlyAffected = myVerifier.getAllAffected(); @@ -361,6 +363,7 @@ public class PatchApplier { return myVerifier.getAllAffected(); } + @CalledInAwt public static void refreshPassedFilesAndMoveToChangelist(@NotNull final Project project, final ContinuationContext context, final Collection directlyAffected, @@ -375,37 +378,32 @@ public class PatchApplier { lfs.refreshAndFindFileByIoFile(filePath.getIOFile()); } lfs.refreshFiles(indirectlyAffected, false, true, null); - ApplicationManager.getApplication().invokeLater(new Runnable() { - @Override - public void run() { - if (project.isDisposed()) return; + if (project.isDisposed()) return; - final ChangeListManager changeListManager = ChangeListManager.getInstance(project); - if (! directlyAffected.isEmpty() && targetChangelistMover != null) { - changeListManager.invokeAfterUpdate(new Runnable() { - @Override - public void run() { - targetChangelistMover.consume(directlyAffected); - if (context != null) { - context.ping(); - } - } - }, InvokeAfterUpdateMode.BACKGROUND_CANCELLABLE, - VcsBundle.message("change.lists.manager.move.changes.to.list"), - new Consumer() { - @Override - public void consume(final VcsDirtyScopeManager vcsDirtyScopeManager) { - markDirty(vcsDirtyScopeManager, directlyAffected, indirectlyAffected); + final ChangeListManager changeListManager = ChangeListManager.getInstance(project); + if (! directlyAffected.isEmpty() && targetChangelistMover != null) { + changeListManager.invokeAfterUpdate(new Runnable() { + @Override + public void run() { + targetChangelistMover.consume(directlyAffected); + if (context != null) { + context.ping(); } - }, null); - } else { - markDirty(VcsDirtyScopeManager.getInstance(project), directlyAffected, indirectlyAffected); - if (context != null) { - context.ping(); } + }, InvokeAfterUpdateMode.BACKGROUND_CANCELLABLE, + VcsBundle.message("change.lists.manager.move.changes.to.list"), + new Consumer() { + @Override + public void consume(final VcsDirtyScopeManager vcsDirtyScopeManager) { + markDirty(vcsDirtyScopeManager, directlyAffected, indirectlyAffected); } + }, null); + } else { + markDirty(VcsDirtyScopeManager.getInstance(project), directlyAffected, indirectlyAffected); + if (context != null) { + context.ping(); } - }); + } } private static void markDirty(@NotNull VcsDirtyScopeManager vcsDirtyScopeManager,