move deleteProfile to impl

This commit is contained in:
Vladimir Krivosheev
2016-10-26 16:42:11 +02:00
parent 1e9f58c53e
commit b7e818d80d
3 changed files with 9 additions and 7 deletions
@@ -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();
@@ -37,7 +37,5 @@ public interface ProfileManager {
@NotNull
String[] getAvailableProfileNames();
void deleteProfile(@NotNull String name);
void addProfileChangeListener(@NotNull ProfileChangeAdapter listener, @NotNull Disposable parent);
}
@@ -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)
}