Merge remote-tracking branch 'origin/master' into develar/is
authorVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Tue, 28 Jun 2016 14:00:01 +0000 (16:00 +0200)
committerVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Tue, 28 Jun 2016 14:00:01 +0000 (16:00 +0200)
1  2 
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/PostHighlightingVisitor.java
java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java
platform/lang-impl/src/com/intellij/codeInspection/InspectionApplication.java
platform/platform-resources/src/META-INF/LangExtensionPoints.xml
platform/util/resources/misc/registry.properties
python/src/com/jetbrains/python/inspections/PyPackageRequirementsInspection.java
xml/xml-psi-impl/src/com/intellij/xml/util/HtmlUtil.java

index a8b9c38b38a975b7610a870d9a97e995edf829b1,7a5002f50a7da6ab6dd0b0a9cedf9d8265ff420e..5f19b419c940cb6d659a5ccad0b10291b72899f6
@@@ -28,10 -28,9 +28,11 @@@ import com.intellij.openapi.util.WriteE
  import com.intellij.profile.Profile;
  import com.intellij.profile.codeInspection.InspectionProfileManager;
  import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
 +import com.intellij.profile.codeInspection.ProjectInspectionProfileManagerImpl;
  import com.intellij.profile.codeInspection.ui.header.InspectionToolsConfigurable;
+ import com.intellij.psi.PsiModifier;
  import com.intellij.testFramework.LightIdeaTestCase;
 +import com.intellij.util.JdomKt;
  import org.jdom.Element;
  import org.jdom.JDOMException;
  import org.jetbrains.annotations.NotNull;
@@@ -297,11 -299,55 +298,51 @@@ public class InspectionProfileTest exte
      profile.readExternal(mergedElement);
      model = profile.getModifiableModel();
      model.commit();
 -    Element copyMerged = new Element("profile");
 -    profile.writeExternal(copyMerged);
 -    assertElementsEqual(mergedElement, copyMerged);
 +    assertElementsEqual(mergedElement, serializeProfile(profile));
  
 -    Element imported = new Element("profile");
 -    importedProfile.writeExternal(imported);
 -    assertElementsEqual(mergedElement, imported);
 +    assertElementsEqual(mergedElement, serializeProfile(importedProfile));
    }
  
+   public void testStoredMemberVisibility() throws Exception {
+     InspectionProfileImpl profile = createProfile(new InspectionProfileImpl("foo"));
+     profile.readExternal(JDOMUtil.loadDocument("<profile version=\"1.0\">\n" +
+                                                "  <inspection_tool class=\"unused\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">\n" +
+                                                "    <option name=\"LOCAL_VARIABLE\" value=\"true\" />\n" +
+                                                "    <option name=\"FIELD\" value=\"true\" />\n" +
+                                                "    <option name=\"METHOD\" value=\"true\" />\n" +
+                                                "    <option name=\"CLASS\" value=\"true\" />\n" +
+                                                "    <option name=\"PARAMETER\" value=\"true\" />\n" +
+                                                "    <option name=\"REPORT_PARAMETER_FOR_PUBLIC_METHODS\" value=\"true\" />\n" +
+                                                "    <option name=\"ADD_MAINS_TO_ENTRIES\" value=\"true\" />\n" +
+                                                "    <option name=\"ADD_APPLET_TO_ENTRIES\" value=\"true\" />\n" +
+                                                "    <option name=\"ADD_SERVLET_TO_ENTRIES\" value=\"true\" />\n" +
+                                                "    <option name=\"ADD_NONJAVA_TO_ENTRIES\" value=\"false\" />\n" +
+                                                "  </inspection_tool>\n" +
+                                                "</profile>").getRootElement());
+     InspectionProfileImpl model = (InspectionProfileImpl)profile.getModifiableModel();
+     InspectionToolWrapper toolWrapper = model.getInspectionTool("unused", getProject());
+     UnusedDeclarationInspectionBase tool = (UnusedDeclarationInspectionBase)toolWrapper.getTool();
+     UnusedSymbolLocalInspectionBase inspectionTool = tool.getSharedLocalInspectionTool();
+     inspectionTool.setClassVisibility("none");
+     model.commit();
+     String mergedText = "<profile version=\"1.0\">\n" +
+                         "  <option name=\"myName\" value=\"ToConvert\" />\n" +
+                         "  <inspection_tool class=\"unused\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\" inner_class=\"none\">\n" +
+                         "    <option name=\"LOCAL_VARIABLE\" value=\"true\" />\n" +
+                         "    <option name=\"FIELD\" value=\"true\" />\n" +
+                         "    <option name=\"METHOD\" value=\"true\" />\n" +
+                         "    <option name=\"CLASS\" value=\"false\" />\n" +
+                         "    <option name=\"PARAMETER\" value=\"true\" />\n" +
+                         "    <option name=\"REPORT_PARAMETER_FOR_PUBLIC_METHODS\" value=\"true\" />\n" +
+                         "    <option name=\"ADD_MAINS_TO_ENTRIES\" value=\"true\" />\n" +
+                         "    <option name=\"ADD_APPLET_TO_ENTRIES\" value=\"true\" />\n" +
+                         "    <option name=\"ADD_SERVLET_TO_ENTRIES\" value=\"true\" />\n" +
+                         "    <option name=\"ADD_NONJAVA_TO_ENTRIES\" value=\"false\" />\n" +
+                         "  </inspection_tool>\n" +
+                         "</profile>";
+     assertEquals(mergedText, serialize(profile));
+   }
    public void testDisabledUnusedDeclarationWithoutChanges() throws Exception {
      checkMergedNoChanges("<profile version=\"1.0\">\n" +
                           "  <option name=\"myName\" value=\"" + PROFILE + "\" />\n" +