inspection view: clear single descriptor in RefElementNode if second problem was...
authorDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Tue, 15 Nov 2016 14:33:09 +0000 (17:33 +0300)
committerDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Tue, 15 Nov 2016 16:25:04 +0000 (19:25 +0300)
platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionRVContentProviderImpl.java
platform/lang-impl/src/com/intellij/codeInspection/ui/RefElementNode.java

index 01a27855fce9780b8c7dde531e88ab4532d51ff3..62132d59866a54127757c3380072cfa294af718c 100644 (file)
@@ -131,9 +131,7 @@ public class InspectionRVContentProviderImpl extends InspectionRVContentProvider
           assert problem != null;
           elemNode
             .insertByOrder(ReadAction.compute(() -> new ProblemDescriptionNode(refElement, problem, toolWrapper, presentation)), true);
-          if (problems.length == 1) {
-            elemNode.setProblem(problems[0]);
-          }
+          elemNode.setProblem(elemNode.getChildCount() == 1 ? problems[0] : null);
         }
     }
     else {
index a92de6a639e900bf1d761d71e14b88e57d36ccaf..bb92904bef591b04b62eee74ac686b3ce79e935d 100644 (file)
@@ -102,7 +102,7 @@ public class RefElementNode extends SuppressableInspectionTreeNode {
     return super.insertByOrder(child, allowDuplication);
   }
 
-  public void setProblem(@NotNull CommonProblemDescriptor descriptor) {
+  public void setProblem(CommonProblemDescriptor descriptor) {
     mySingleDescriptor = descriptor;
   }