mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
check enabled status for simple global inspections (IDEA-135031)
This commit is contained in:
+12
-13
@@ -380,17 +380,16 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp
|
||||
final List<LocalInspectionToolWrapper> lTools = getWrappersFromTools(localTools, file);
|
||||
pass.doInspectInBatch(this, inspectionManager, lTools);
|
||||
|
||||
JobLauncher.getInstance().invokeConcurrentlyUnderProgress(globalSimpleTools, myProgressIndicator, false, new Processor<Tools>() {
|
||||
JobLauncher.getInstance().invokeConcurrentlyUnderProgress(getWrappersFromTools(globalSimpleTools, file), myProgressIndicator, false, new Processor<GlobalInspectionToolWrapper>() {
|
||||
@Override
|
||||
public boolean process(Tools tools) {
|
||||
GlobalInspectionToolWrapper toolWrapper = (GlobalInspectionToolWrapper)tools.getTool();
|
||||
GlobalSimpleInspectionTool tool = (GlobalSimpleInspectionTool)toolWrapper.getTool();
|
||||
ProblemsHolder problemsHolder = new ProblemsHolder(inspectionManager, file, false);
|
||||
ProblemDescriptionsProcessor problemDescriptionProcessor = getProblemDescriptionProcessor(toolWrapper, wrappersMap);
|
||||
tool.checkFile(file, inspectionManager, problemsHolder, GlobalInspectionContextImpl.this, problemDescriptionProcessor);
|
||||
InspectionToolPresentation toolPresentation = getPresentation(toolWrapper);
|
||||
LocalDescriptorsUtil.addProblemDescriptors(problemsHolder.getResults(), false, GlobalInspectionContextImpl.this, null,
|
||||
CONVERT, toolPresentation);
|
||||
public boolean process(GlobalInspectionToolWrapper toolWrapper) {
|
||||
GlobalSimpleInspectionTool tool = (GlobalSimpleInspectionTool)toolWrapper.getTool();
|
||||
ProblemsHolder problemsHolder = new ProblemsHolder(inspectionManager, file, false);
|
||||
ProblemDescriptionsProcessor problemDescriptionProcessor = getProblemDescriptionProcessor(toolWrapper, wrappersMap);
|
||||
tool.checkFile(file, inspectionManager, problemsHolder, GlobalInspectionContextImpl.this, problemDescriptionProcessor);
|
||||
InspectionToolPresentation toolPresentation = getPresentation(toolWrapper);
|
||||
LocalDescriptorsUtil.addProblemDescriptors(problemsHolder.getResults(), false, GlobalInspectionContextImpl.this, null,
|
||||
CONVERT, toolPresentation);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -575,10 +574,10 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp
|
||||
}
|
||||
}
|
||||
|
||||
private static List<LocalInspectionToolWrapper> getWrappersFromTools(List<Tools> localTools, PsiFile file) {
|
||||
final List<LocalInspectionToolWrapper> lTools = new ArrayList<LocalInspectionToolWrapper>();
|
||||
private static <T extends InspectionToolWrapper> List<T> getWrappersFromTools(List<Tools> localTools, PsiFile file) {
|
||||
final List<T> lTools = new ArrayList<T>();
|
||||
for (Tools tool : localTools) {
|
||||
final LocalInspectionToolWrapper enabledTool = (LocalInspectionToolWrapper)tool.getEnabledTool(file);
|
||||
final T enabledTool = (T)tool.getEnabledTool(file);
|
||||
if (enabledTool != null) {
|
||||
lTools.add(enabledTool);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user