From a00356272b33ce8181bb2e72ed9a62809cc6e074 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 31 Mar 2016 12:57:26 +0300 Subject: [PATCH] do not register components manually in Disposer since they are already there --- .../intellij/codeInspection/ex/EntryPointsManagerBase.java | 2 -- .../codeInspection/reference/RefJavaManagerImpl.java | 4 +++- .../src/com/intellij/dvcs/repo/VcsRepositoryManager.java | 4 +--- .../settings/AbstractExternalSystemSettings.java | 4 +--- .../notification/ExternalSystemNotificationManager.java | 1 - .../service/project/manage/ExternalProjectsManager.java | 1 - .../externalSystem/test/TestExternalSystemManager.groovy | 5 +++-- .../intellij/codeInsight/daemon/impl/DaemonListeners.java | 1 - .../src/com/intellij/execution/TestStateStorage.java | 4 +--- .../com/intellij/ide/projectView/impl/ProjectViewImpl.java | 2 -- .../src/com/intellij/vcs/log/data/VcsUserRegistryImpl.java | 4 +--- .../impl/src/com/intellij/vcs/log/impl/VcsLogManager.java | 4 +--- .../src/com/intellij/vcs/log/impl/VcsRootsRegistryImpl.java | 4 +--- .../src/com/intellij/cvsSupport2/ui/CvsTabbedWindow.java | 2 -- plugins/git4idea/src/git4idea/GitUserRegistry.java | 4 +--- .../git4idea/src/git4idea/branch/DeepComparatorHolder.java | 4 +--- .../org/jetbrains/idea/svn/history/LoadedRevisionsCache.java | 4 +--- 17 files changed, 15 insertions(+), 39 deletions(-) diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java index 064f7276d475..ab23d803aa57 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java @@ -30,7 +30,6 @@ import com.intellij.openapi.extensions.PluginDescriptor; import com.intellij.openapi.extensions.impl.ExtensionPointImpl; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.JDOMExternalizableStringList; import com.intellij.profile.codeInspection.InspectionProfileManager; import com.intellij.psi.PsiDocCommentOwner; @@ -86,7 +85,6 @@ public abstract class EntryPointsManagerBase extends EntryPointsManager implemen myProject = project; myTemporaryEntryPoints = new HashSet(); myPersistentEntryPoints = new LinkedHashMap(); // To keep the order between readExternal to writeExternal - Disposer.register(project, this); final ExtensionPoint point = Extensions.getRootArea().getExtensionPoint(ToolExtensionPoints.DEAD_CODE_TOOL); ((ExtensionPointImpl)point).addExtensionPointListener(new ExtensionPointListener() { @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaManagerImpl.java b/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaManagerImpl.java index 6ea8d8468db2..7ab3f1d62415 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaManagerImpl.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -374,6 +374,8 @@ public class RefJavaManagerImpl extends RefJavaManager { return null; } }; + Disposer.register(project, myEntryPointsManager); + ((EntryPointsManagerBase)myEntryPointsManager).addAllPersistentEntries(EntryPointsManagerBase.getInstance(project)); } return myEntryPointsManager; diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java b/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java index cde205a645f1..6e3c0348afdf 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Condition; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.vcs.AbstractVcs; import com.intellij.openapi.vcs.ProjectLevelVcsManager; import com.intellij.openapi.vcs.VcsListener; @@ -70,7 +69,6 @@ public class VcsRepositoryManager extends AbstractProjectComponent implements Di @Override public void initComponent() { - Disposer.register(myProject, this); myProject.getMessageBus().connect().subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, this); } diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemSettings.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemSettings.java index 2cef0b6f12f3..280da73e6538 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemSettings.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.intellij.openapi.externalSystem.settings; import com.intellij.openapi.Disposable; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Disposer; import com.intellij.util.containers.ContainerUtilRt; import com.intellij.util.messages.Topic; import org.jetbrains.annotations.NotNull; @@ -53,7 +52,6 @@ public abstract class AbstractExternalSystemSettings< protected AbstractExternalSystemSettings(@NotNull Topic topic, @NotNull Project project) { myChangesTopic = topic; myProject = project; - Disposer.register(project, this); } @Override diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/notification/ExternalSystemNotificationManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/notification/ExternalSystemNotificationManager.java index 49aa338ae1a5..dacb98ca9f38 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/notification/ExternalSystemNotificationManager.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/notification/ExternalSystemNotificationManager.java @@ -84,7 +84,6 @@ public class ExternalSystemNotificationManager implements Disposable { public ExternalSystemNotificationManager(@NotNull final Project project) { myProject = project; - Disposer.register(project, this); myNotifications = ContainerUtil.newConcurrentSet(); initializedExternalSystem = ContainerUtil.newConcurrentSet(); myMessageCounter = new MessageCounter(); diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java index b818c9faf6f5..4654a1fddf8e 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java @@ -73,7 +73,6 @@ public class ExternalProjectsManager implements PersistentStateComponent TestExternalSystemExecutionSettings executionSettings TestExternalSystemManager(@NotNull Project project) { - systemSettings = new TestExternalSystemSettings(project) + Disposer.register(project, systemSettings = new TestExternalSystemSettings(project)) localSettings = new TestExternalSystemLocalSettings(project) executionSettings = new TestExternalSystemExecutionSettings() } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonListeners.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonListeners.java index 87aa680dc876..2b1d64b2fcfd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonListeners.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonListeners.java @@ -142,7 +142,6 @@ public class DaemonListeners implements Disposable { @NotNull ProjectLevelVcsManager projectLevelVcsManager, @NotNull VcsDirtyScopeManager vcsDirtyScopeManager, @NotNull FileStatusManager fileStatusManager) { - Disposer.register(project, this); myProject = project; myDaemonCodeAnalyzer = daemonCodeAnalyzer; myPsiDocumentManager = psiDocumentManager; diff --git a/platform/lang-impl/src/com/intellij/execution/TestStateStorage.java b/platform/lang-impl/src/com/intellij/execution/TestStateStorage.java index 5826d53ac6f4..76edc645f6fb 100644 --- a/platform/lang-impl/src/com/intellij/execution/TestStateStorage.java +++ b/platform/lang-impl/src/com/intellij/execution/TestStateStorage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.intellij.openapi.application.PathManager; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.ThrowableComputable; import com.intellij.openapi.util.io.FileUtilRt; import com.intellij.openapi.vfs.newvfs.persistent.FlushingDaemon; @@ -87,7 +86,6 @@ public class TestStateStorage implements Disposable { } }); - Disposer.register(project, this); } private PersistentHashMap initializeMap() throws IOException { diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java index 74c0b87a7dd4..852fbc754e63 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java @@ -199,8 +199,6 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo constructUi(); - - Disposer.register(myProject, this); myFileEditorManager = fileEditorManager; myConnection = project.getMessageBus().connect(); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsUserRegistryImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsUserRegistryImpl.java index 55d903cf794e..e89ebabd0c2a 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsUserRegistryImpl.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/VcsUserRegistryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.ThrowableComputable; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.Interner; @@ -58,7 +57,6 @@ public class VcsUserRegistryImpl implements Disposable, VcsUserRegistry { VcsUserRegistryImpl(@NotNull Project project) { final File mapFile = new File(USER_CACHE_APP_DIR, project.getLocationHash() + "." + STORAGE_VERSION); - Disposer.register(project, this); myPersistentEnumerator = initEnumerator(mapFile); myInterner = new Interner(); } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java index 784b54cda055..40cfb7d22128 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,8 +63,6 @@ public class VcsLogManager implements Disposable { public VcsLogManager(@NotNull Project project, @NotNull VcsLogTabsProperties uiProperties) { myProject = project; myUiProperties = uiProperties; - - Disposer.register(project, this); } public VcsLogDataManager getDataManager() { diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsRootsRegistryImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsRootsRegistryImpl.java index 0f00dc29840f..a3ef557e91bf 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsRootsRegistryImpl.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsRootsRegistryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package com.intellij.vcs.log.impl; import com.intellij.openapi.Disposable; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.io.PersistentStringEnumerator; @@ -36,7 +35,6 @@ public class VcsRootsRegistryImpl implements VcsRootsRegistry, Disposable { public VcsRootsRegistryImpl(@NotNull final Project project) { myEnumerator = createEnumerator(project); - Disposer.register(project, this); } @NotNull diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/CvsTabbedWindow.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/CvsTabbedWindow.java index f9ac513e2e54..6c0a90b024e5 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/CvsTabbedWindow.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/CvsTabbedWindow.java @@ -28,7 +28,6 @@ import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorFactory; import com.intellij.openapi.editor.EditorSettings; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; @@ -56,7 +55,6 @@ public class CvsTabbedWindow implements Disposable { public CvsTabbedWindow(Project project) { myProject = project; - Disposer.register(project, this); ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { diff --git a/plugins/git4idea/src/git4idea/GitUserRegistry.java b/plugins/git4idea/src/git4idea/GitUserRegistry.java index 9cccb0c53d05..54521af47d86 100644 --- a/plugins/git4idea/src/git4idea/GitUserRegistry.java +++ b/plugins/git4idea/src/git4idea/GitUserRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Condition; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.ProjectLevelVcsManager; import com.intellij.openapi.vcs.VcsException; @@ -49,7 +48,6 @@ public class GitUserRegistry implements Disposable, VcsListener { myProject = project; myVcsManager = vcsManager; myFactory = factory; - Disposer.register(myProject, this); } public void activate() { diff --git a/plugins/git4idea/src/git4idea/branch/DeepComparatorHolder.java b/plugins/git4idea/src/git4idea/branch/DeepComparatorHolder.java index fdab43700b50..2a083ac76dcf 100644 --- a/plugins/git4idea/src/git4idea/branch/DeepComparatorHolder.java +++ b/plugins/git4idea/src/git4idea/branch/DeepComparatorHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package git4idea.branch; import com.intellij.openapi.Disposable; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Disposer; import com.intellij.util.containers.ContainerUtil; import com.intellij.vcs.log.VcsLogUi; import git4idea.repo.GitRepositoryManager; @@ -38,7 +37,6 @@ public class DeepComparatorHolder implements Disposable { myProject = project; myRepositoryManager = repositoryManager; myComparators = ContainerUtil.newHashMap(); - Disposer.register(project, this); } @NotNull diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LoadedRevisionsCache.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LoadedRevisionsCache.java index 7e1c9d155a0e..c84c5ae66ded 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LoadedRevisionsCache.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/LoadedRevisionsCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.vcs.RepositoryLocation; import com.intellij.openapi.vcs.changes.committed.ChangesBunch; import com.intellij.openapi.vcs.changes.committed.CommittedChangesAdapter; @@ -63,7 +62,6 @@ public class LoadedRevisionsCache implements Disposable { }); } }); - Disposer.register(myProject, this); setRefreshTime(0); }