From da35cce150576016fc656f7274474d9256d49ca8 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Mon, 27 Nov 2017 19:58:06 +0300 Subject: [PATCH] merge DefaultInspectionToolPresentation.myModulesProblems field content to myContents --- .../ex/InspectionRVContentProviderImpl.java | 11 --------- .../ui/DefaultInspectionToolPresentation.java | 23 +++++-------------- .../ui/InspectionToolPresentation.java | 17 +------------- 3 files changed, 7 insertions(+), 44 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionRVContentProviderImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionRVContentProviderImpl.java index 548862cf10ec..f92e9da510db 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionRVContentProviderImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionRVContentProviderImpl.java @@ -7,7 +7,6 @@ package com.intellij.codeInspection.ex; import com.intellij.codeInspection.CommonProblemDescriptor; import com.intellij.codeInspection.reference.RefElement; import com.intellij.codeInspection.reference.RefEntity; -import com.intellij.codeInspection.reference.RefModule; import com.intellij.codeInspection.reference.RefUtil; import com.intellij.codeInspection.ui.*; import com.intellij.codeInspection.ui.util.SynchronizedBidiMultiMap; @@ -81,16 +80,6 @@ public class InspectionRVContentProviderImpl extends InspectionRVContentProvider final InspectionToolWrapper toolWrapper = toolNode.getToolWrapper(); InspectionNode mergedToolNode = (InspectionNode)merge(toolNode, parentNode, !groupBySeverity); - InspectionToolPresentation presentation = context.getPresentation(toolWrapper); - final Set moduleProblems = presentation.getModuleProblems(); - if (!moduleProblems.isEmpty()) { - Set entities = contents.get(""); - if (entities == null) { - entities = new HashSet<>(); - contents.put("", entities); - } - entities.addAll(moduleProblems); - } buildTree(context, contents, false, diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java index 11bdb402b5c2..51036a5ec5a3 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java @@ -1,4 +1,6 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +/* + * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. + */ package com.intellij.codeInspection.ui; import com.intellij.codeHighlighting.HighlightDisplayLevel; @@ -58,7 +60,6 @@ public class DefaultInspectionToolPresentation implements InspectionToolPresenta private final SynchronizedBidiMultiMap myExcludedElements = createBidiMap(); protected final Map> myContents = Collections.synchronizedMap(new HashMap>(1)); // keys can be null - private final Set myModulesProblems = Collections.synchronizedSet(ContainerUtil.newIdentityTroveSet()); private DescriptorComposer myComposer; private volatile boolean isDisposed; @@ -435,13 +436,12 @@ public class DefaultInspectionToolPresentation implements InspectionToolPresenta @Override public synchronized boolean hasReportedProblems() { - return !myContents.isEmpty() || !myModulesProblems.isEmpty(); + return !myContents.isEmpty(); } @Override public synchronized void updateContent() { myContents.clear(); - myModulesProblems.clear(); updateProblemElements(); } @@ -449,13 +449,8 @@ public class DefaultInspectionToolPresentation implements InspectionToolPresenta final Collection elements = getProblemElements().keys(); for (RefEntity element : elements) { if (getContext().getUIOptions().FILTER_RESOLVED_ITEMS && (isProblemResolved(element) || isSuppressed(element) || isExcluded(element))) continue; - if (element instanceof RefModule) { - myModulesProblems.add((RefModule)element); - } - else { - String groupName = element instanceof RefElement ? element.getRefManager().getGroupName((RefElement)element) : element.getQualifiedName() ; - registerContentEntry(element, groupName); - } + String groupName = element instanceof RefElement ? element.getRefManager().getGroupName((RefElement)element) : element.getQualifiedName() ; + registerContentEntry(element, groupName); } } @@ -470,12 +465,6 @@ public class DefaultInspectionToolPresentation implements InspectionToolPresenta return myContents; } - @NotNull - @Override - public Set getModuleProblems() { - return myModulesProblems; - } - @Override @NotNull public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, InspectionTree tree) { diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionToolPresentation.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionToolPresentation.java index 399fbc00a74c..100d948546a4 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionToolPresentation.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionToolPresentation.java @@ -1,17 +1,5 @@ /* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. */ package com.intellij.codeInspection.ui; @@ -24,7 +12,6 @@ import com.intellij.codeInspection.ProblemDescriptionsProcessor; import com.intellij.codeInspection.ex.*; import com.intellij.codeInspection.reference.RefElement; import com.intellij.codeInspection.reference.RefEntity; -import com.intellij.codeInspection.reference.RefModule; import com.intellij.codeInspection.ui.util.SynchronizedBidiMultiMap; import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; @@ -91,8 +78,6 @@ public interface InspectionToolPresentation extends ProblemDescriptionsProcessor HTMLComposerImpl getComposer(); void exportResults(@NotNull final Element parentNode, @NotNull RefEntity refEntity, Predicate isDescriptorExcluded); @NotNull - Set getModuleProblems(); - @NotNull QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, @Nullable InspectionTree tree); @NotNull SynchronizedBidiMultiMap getProblemElements();