merge DefaultInspectionToolPresentation.myModulesProblems field content to myContents

This commit is contained in:
Dmitry Batkovich
2017-12-11 15:41:36 +03:00
parent be28384c8a
commit da35cce150
3 changed files with 7 additions and 44 deletions
@@ -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<RefModule> moduleProblems = presentation.getModuleProblems();
if (!moduleProblems.isEmpty()) {
Set<RefEntity> entities = contents.get("");
if (entities == null) {
entities = new HashSet<>();
contents.put("", entities);
}
entities.addAll(moduleProblems);
}
buildTree(context,
contents,
false,
@@ -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<RefEntity, CommonProblemDescriptor> myExcludedElements = createBidiMap();
protected final Map<String, Set<RefEntity>> myContents = Collections.synchronizedMap(new HashMap<String, Set<RefEntity>>(1)); // keys can be null
private final Set<RefModule> 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<RefEntity> 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<RefModule> getModuleProblems() {
return myModulesProblems;
}
@Override
@NotNull
public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, InspectionTree tree) {
@@ -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<CommonProblemDescriptor> isDescriptorExcluded);
@NotNull
Set<RefModule> getModuleProblems();
@NotNull
QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, @Nullable InspectionTree tree);
@NotNull
SynchronizedBidiMultiMap<RefEntity, CommonProblemDescriptor> getProblemElements();