From 936fecbe415aa716fa32cd80df42d0251c66972a Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Thu, 19 Oct 2017 20:41:06 +0200 Subject: [PATCH] naming conventions: preserve unknown settings --- .../ex/InspectionProfileTest.java | 29 +++++++++++++++++++ .../AbstractNamingConventionInspection.java | 16 ++++++++-- 2 files changed, 43 insertions(+), 2 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 027d400fccd6..bc6c6c798411 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java @@ -462,6 +462,35 @@ public class InspectionProfileTest extends LightIdeaTestCase { assertThat(importedProfile.writeScheme()).isEqualTo(mergedElement); } + public void testKeepUnloadedMergeNamingConventions() throws Exception { + String unchanged = "\n" + + " "; + final Element allEnabledProfile = JdomKt.loadElement(unchanged); + InspectionProfileImpl profile = createProfile(new InspectionProfileImpl("foo")); + profile.readExternal(allEnabledProfile); + profile.initInspectionTools(); + assertEquals(unchanged, serialize(profile)); + } + public void testMergeMethodNamingConventions() throws Exception { final Element element = JdomKt.loadElement("\n" + "