From b7e818d80d25eee2ea3475dd9473c9293c5d6b7a Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 26 Oct 2016 16:34:03 +0200 Subject: [PATCH] move deleteProfile to impl --- .../codeInspection/ex/InspectionProfileTest.java | 12 ++++++++---- .../src/com/intellij/profile/ProfileManager.java | 2 -- .../codeInspection/BaseInspectionProfileManager.kt | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java index 920ace8adf1a..75d618dd3a19 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java @@ -68,10 +68,15 @@ public class InspectionProfileTest extends LightIdeaTestCase { finally { //noinspection AssignmentToStaticFieldFromInstanceMethod InspectionProfileImpl.INIT_INSPECTIONS = false; - InspectionProfileManager.getInstance().deleteProfile(PROFILE); + getApplicationProfileManager().deleteProfile(PROFILE); } } + @NotNull + private static BaseInspectionProfileManager getApplicationProfileManager() { + return (BaseInspectionProfileManager)InspectionProfileManager.getInstance(); + } + public void testCopyProjectProfile() throws Exception { final Element element = loadProfile(); final InspectionProfileImpl profile = createProfile(); @@ -90,7 +95,7 @@ public class InspectionProfileTest extends LightIdeaTestCase { } public void testSameNameSharedProfile() throws Exception { - BaseInspectionProfileManager profileManager = (BaseInspectionProfileManager)InspectionProfileManager.getInstance(); + BaseInspectionProfileManager profileManager = getApplicationProfileManager(); InspectionProfileImpl localProfile = createProfile(); profileManager.updateProfile(localProfile); @@ -291,8 +296,7 @@ public class InspectionProfileTest extends LightIdeaTestCase { Element toImportElement = profile.writeScheme(); final InspectionProfileImpl importedProfile = - InspectionToolsConfigurable.importInspectionProfile(toImportElement, - (BaseInspectionProfileManager)InspectionProfileManager.getInstance(), getProject(), null); + InspectionToolsConfigurable.importInspectionProfile(toImportElement, getApplicationProfileManager(), getProject(), null); //check merged Element mergedElement = JDOMUtil.loadDocument(mergedText).getRootElement(); diff --git a/platform/analysis-api/src/com/intellij/profile/ProfileManager.java b/platform/analysis-api/src/com/intellij/profile/ProfileManager.java index b76209e34258..9818ac61e8b6 100644 --- a/platform/analysis-api/src/com/intellij/profile/ProfileManager.java +++ b/platform/analysis-api/src/com/intellij/profile/ProfileManager.java @@ -37,7 +37,5 @@ public interface ProfileManager { @NotNull String[] getAvailableProfileNames(); - void deleteProfile(@NotNull String name); - void addProfileChangeListener(@NotNull ProfileChangeAdapter listener, @NotNull Disposable parent); } diff --git a/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt b/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt index 6d3b3590f600..d7f61679a711 100644 --- a/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt +++ b/platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt @@ -71,7 +71,7 @@ abstract class BaseInspectionProfileManager(messageBus: MessageBus) : Inspectio schemeManager.addScheme(profile) } - override final fun deleteProfile(name: String) { + final fun deleteProfile(name: String) { schemeManager.removeScheme(name)?.let { schemeRemoved(it) }