do not register components manually in Disposer since they are already there

This commit is contained in:
Alexey Kudravtsev
2016-03-31 13:08:11 +03:00
parent 0001d8e402
commit a00356272b
17 changed files with 15 additions and 39 deletions
@@ -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<RefElement>();
myPersistentEntryPoints = new LinkedHashMap<String, SmartRefElementPointer>(); // To keep the order between readExternal to writeExternal
Disposer.register(project, this);
final ExtensionPoint<EntryPoint> point = Extensions.getRootArea().getExtensionPoint(ToolExtensionPoints.DEAD_CODE_TOOL);
((ExtensionPointImpl)point).addExtensionPointListener(new ExtensionPointListener<EntryPoint>() {
@Override
@@ -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;
@@ -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);
}
@@ -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<L> topic, @NotNull Project project) {
myChangesTopic = topic;
myProject = project;
Disposer.register(project, this);
}
@Override
@@ -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();
@@ -73,7 +73,6 @@ public class ExternalProjectsManager implements PersistentStateComponent<Externa
public ExternalProjectsManager(@NotNull Project project) {
myProject = project;
Disposer.register(project, this);
myShortcutsManager = new ExternalSystemShortcutsManager(project);
Disposer.register(this, myShortcutsManager);
myTaskActivator = new ExternalSystemTaskActivator(project);
@@ -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.
@@ -23,6 +23,7 @@ import com.intellij.openapi.externalSystem.service.project.ExternalSystemProject
import com.intellij.openapi.externalSystem.task.ExternalSystemTaskManager
import com.intellij.openapi.fileChooser.FileChooserDescriptor
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.Pair
import com.intellij.util.Function
import org.jetbrains.annotations.NotNull
@@ -43,7 +44,7 @@ TestExternalSystemExecutionSettings>
TestExternalSystemExecutionSettings executionSettings
TestExternalSystemManager(@NotNull Project project) {
systemSettings = new TestExternalSystemSettings(project)
Disposer.register(project, systemSettings = new TestExternalSystemSettings(project))
localSettings = new TestExternalSystemLocalSettings(project)
executionSettings = new TestExternalSystemExecutionSettings()
}
@@ -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;
@@ -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<String, Record> initializeMap() throws IOException {
@@ -199,8 +199,6 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
constructUi();
Disposer.register(myProject, this);
myFileEditorManager = fileEditorManager;
myConnection = project.getMessageBus().connect();
@@ -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<VcsUser>();
}
@@ -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() {
@@ -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
@@ -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() {
@@ -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() {
@@ -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
@@ -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);
}