mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
merge DefaultInspectionToolPresentation.myModulesProblems field content to myContents
This commit is contained in:
-11
@@ -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,
|
||||
|
||||
+6
-17
@@ -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
-16
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user