From e2121d5da362e7f39fd8e9ffa1df12e79058f57f Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 18 Dec 2019 09:23:57 +0100 Subject: [PATCH] IDEA-CR-56674 cleanup GitOrigin-RevId: df19655fce9e97febb641faf804d76fedca746b4 --- .../build/BuildContentManagerImpl.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/build/BuildContentManagerImpl.java b/platform/lang-impl/src/com/intellij/build/BuildContentManagerImpl.java index a001b68b947f..4951654081f6 100644 --- a/platform/lang-impl/src/com/intellij/build/BuildContentManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/build/BuildContentManagerImpl.java @@ -49,12 +49,24 @@ public final class BuildContentManagerImpl implements BuildContentManager { private static final String[] ourPresetOrder = {Sync, Build, Run, Debug}; private static final Key> CONTENT_CLOSE_LISTENERS = Key.create("CONTENT_CLOSE_LISTENERS"); - private Project myProject; + private final Project myProject; private List myPostponedRunnables = new ArrayList<>(); private final Map> liveContentsMap = ContainerUtil.newConcurrentMap(); public BuildContentManagerImpl(@NotNull Project project) { - init(project); + myProject = project; + if (project.isDefault()) { + return; + } + + StartupManager.getInstance(project).runAfterOpened(() -> { + ApplicationManager.getApplication().invokeLater(() -> { + for (Runnable postponedRunnable : myPostponedRunnables) { + postponedRunnable.run(); + } + myPostponedRunnables = null; + }, ModalityState.NON_MODAL, project.getDisposed()); + }); } @Override @@ -88,22 +100,6 @@ public final class BuildContentManagerImpl implements BuildContentManager { return toolWindow; } - private void init(@NotNull Project project) { - myProject = project; - if (project.isDefault()) { - return; - } - - StartupManager.getInstance(project).runAfterOpened(() -> { - ApplicationManager.getApplication().invokeLater(() -> { - for (Runnable postponedRunnable : myPostponedRunnables) { - postponedRunnable.run(); - } - myPostponedRunnables = null; - }, ModalityState.NON_MODAL, project.getDisposed()); - }); - } - private void runWhenInitialized(@NotNull Runnable runnable) { if (myPostponedRunnables == null) { runnable.run();