inspection profile: tolerate commit of a model without modifications in tools (IDEA-234149)

GitOrigin-RevId: 1c54ed295201c756138507d953ba35025b24126e
This commit is contained in:
Anna.Kozlova
2020-03-10 10:32:28 +00:00
committed by intellij-monorepo-bot
parent 2f1890ee90
commit fbe35fb8de
2 changed files with 14 additions and 2 deletions
@@ -107,6 +107,16 @@ public class InspectionProfileTest extends LightIdeaTestCase {
return new InspectionProfileImpl(PROFILE, InspectionToolRegistrar.getInstance(), base);
}
public void testModificationWithoutModification() {
InspectionProfileImpl profile = createProfile();
profile.getAllTools();
assertTrue(profile.wasInitialized());
assertNotEmpty(profile.myTools.keySet());
profile.modifyProfile(m -> {});
assertTrue(profile.wasInitialized());
assertNotEmpty(profile.myTools.keySet());
}
public void testSameNameSharedProfile() {
BaseInspectionProfileManager profileManager = getApplicationProfileManager();
InspectionProfileImpl localProfile = createProfile();
@@ -113,8 +113,10 @@ open class InspectionProfileModifiableModel(val source: InspectionProfileImpl) :
description = model.description
isProjectLevel = model.isProjectLevel
myLockedProfile = model.myLockedProfile
myChangedToolNames = model.myChangedToolNames
myTools = model.myTools
myChangedToolNames = null
if (model.wasInitialized()) {
myTools = model.myTools
}
profileManager = model.profileManager
}