From 69ed314a2feb2c3f68192a667bb6e5d9f47924a6 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 3 Jul 2013 17:43:53 +0400 Subject: [PATCH] notnull, cleanup --- .../profile/DefaultProjectProfileManager.java | 6 ++--- .../InspectionProfileManager.java | 26 ------------------- .../InspectionProjectProfileManager.java | 4 ++- .../InspectionProjectProfileManagerImpl.java | 16 +++++++----- 4 files changed, 15 insertions(+), 37 deletions(-) diff --git a/platform/analysis-api/src/com/intellij/profile/DefaultProjectProfileManager.java b/platform/analysis-api/src/com/intellij/profile/DefaultProjectProfileManager.java index ce8310fcdce0..4e116fc77ff8 100644 --- a/platform/analysis-api/src/com/intellij/profile/DefaultProjectProfileManager.java +++ b/platform/analysis-api/src/com/intellij/profile/DefaultProjectProfileManager.java @@ -64,12 +64,12 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager private final List myProfilesListener = ContainerUtil.createLockFreeCopyOnWriteList(); @NonNls private static final String PROJECT_DEFAULT_PROFILE_NAME = "Project Default"; - public DefaultProjectProfileManager(@NotNull final Project project, final ApplicationProfileManager applicationProfileManager, - final DependencyValidationManager holder) { + public DefaultProjectProfileManager(@NotNull final Project project, + @NotNull ApplicationProfileManager applicationProfileManager, + @NotNull DependencyValidationManager holder) { myProject = project; myHolder = holder; myApplicationProfileManager = applicationProfileManager; - LOG.assertTrue(myApplicationProfileManager != null); } @NotNull diff --git a/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java b/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java index e68f80b03b17..dce1d0abe258 100644 --- a/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java +++ b/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java @@ -32,7 +32,6 @@ import org.jetbrains.annotations.Nullable; import java.io.File; import java.io.IOException; -import java.util.Collection; import java.util.List; /** @@ -53,10 +52,6 @@ public abstract class InspectionProfileManager extends ApplicationProfileManager public InspectionProfileManager() { } - @Override - @NotNull - public abstract Collection getProfiles(); - protected abstract void initProfiles(); public abstract Profile loadProfile(@NotNull String path) throws IOException, JDOMException; @@ -67,13 +62,6 @@ public abstract class InspectionProfileManager extends ApplicationProfileManager return "InspectionProfileManager"; } - @Override - public abstract void updateProfile(@NotNull Profile profile); - - - @Override - public abstract Profile createProfile(); - @Override public void addProfileChangeListener(@NotNull final ProfileChangeAdapter listener) { myProfileChangeAdapters.add(listener); @@ -103,16 +91,6 @@ public abstract class InspectionProfileManager extends ApplicationProfileManager } } - @Override - public abstract Profile getProfile(@NotNull final String name, boolean returnRootProfileIfNamedIsAbsent); - - @Override - @NotNull - public abstract Profile getRootProfile(); - - @Override - public abstract void deleteProfile(final String profile); - @Nullable public static File getProfileDirectory() { String directoryPath = PathManager.getConfigPath() + File.separator + INSPECTION_DIR; @@ -125,10 +103,6 @@ public abstract class InspectionProfileManager extends ApplicationProfileManager return directory; } - @Override - @NotNull - public abstract String[] getAvailableProfileNames(); - @Override public Profile getProfile(@NotNull final String name) { return getProfile(name, true); diff --git a/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManager.java b/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManager.java index 7299cbcb7d6d..3eff81302260 100644 --- a/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManager.java +++ b/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManager.java @@ -34,7 +34,9 @@ import org.jetbrains.annotations.NotNull; * Date: 30-Nov-2005 */ public abstract class InspectionProjectProfileManager extends DefaultProjectProfileManager implements ProjectComponent, PersistentStateComponent { - public InspectionProjectProfileManager(final Project project, InspectionProfileManager inspectionProfileManager, DependencyValidationManager holder) { + public InspectionProjectProfileManager(@NotNull Project project, + @NotNull InspectionProfileManager inspectionProfileManager, + @NotNull DependencyValidationManager holder) { super(project, inspectionProfileManager, holder); } diff --git a/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManagerImpl.java b/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManagerImpl.java index 51c596d07ed8..34fff8776f3e 100644 --- a/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManagerImpl.java +++ b/platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManagerImpl.java @@ -61,10 +61,10 @@ public class InspectionProjectProfileManagerImpl extends InspectionProjectProfil private final NamedScopeManager myLocalScopesHolder; private NamedScopesHolder.ScopeListener myScopeListener; - public InspectionProjectProfileManagerImpl(final Project project, - InspectionProfileManager inspectionProfileManager, - DependencyValidationManager holder, - NamedScopeManager localScopesHolder) { + public InspectionProjectProfileManagerImpl(@NotNull Project project, + @NotNull InspectionProfileManager inspectionProfileManager, + @NotNull DependencyValidationManager holder, + @NotNull NamedScopeManager localScopesHolder) { super(project, inspectionProfileManager, holder); myLocalScopesHolder = localScopesHolder; mySeverityRegistrar = new SeverityRegistrar(); @@ -133,7 +133,9 @@ public class InspectionProjectProfileManagerImpl extends InspectionProjectProfil @Override public void projectOpened() { - StartupManager.getInstance(myProject).registerPostStartupActivity(new DumbAwareRunnable() { + StartupManager startupManager = StartupManager.getInstance(myProject); + if (startupManager == null) return; // upsource + startupManager.registerPostStartupActivity(new DumbAwareRunnable() { @Override public void run() { final Set profiles = new HashSet(); @@ -170,8 +172,8 @@ public class InspectionProjectProfileManagerImpl extends InspectionProjectProfil Disposer.register(myProject, new Disposable() { @Override public void dispose() { - myHolder.removeScopeListener(myScopeListener); - myLocalScopesHolder.removeScopeListener(myScopeListener); + myHolder.removeScopeListener(myScopeListener); + myLocalScopesHolder.removeScopeListener(myScopeListener); } }); }