This commit is contained in:
Alexey Kudravtsev
2015-02-25 14:42:53 +03:00
parent 351eeb1373
commit cf98c6fccd
2 changed files with 13 additions and 12 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2015 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.
@@ -73,14 +73,15 @@ public abstract class InspectionToolWrapper<T extends InspectionProfileEntry, E
@NotNull
public T getTool() {
if (myTool == null) {
T tool = myTool;
if (tool == null) {
//noinspection unchecked
myTool = (T)myEP.instantiateTool();
if (!myTool.getShortName().equals(myEP.getShortName())) {
LOG.error("Short name not matched for " + myTool.getClass() + ": getShortName() = " + myTool.getShortName() + "; ep.shortName = " + myEP.getShortName());
myTool = tool = (T)myEP.instantiateTool();
if (!tool.getShortName().equals(myEP.getShortName())) {
LOG.error("Short name not matched for " + tool.getClass() + ": getShortName() = " + tool.getShortName() + "; ep.shortName = " + myEP.getShortName());
}
}
return myTool;
return tool;
}
public boolean isInitialized() {
@@ -698,8 +698,8 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
}
private static class InspectionResult {
@NotNull public final LocalInspectionToolWrapper tool;
@NotNull public final List<ProblemDescriptor> foundProblems;
@NotNull private final LocalInspectionToolWrapper tool;
@NotNull private final List<ProblemDescriptor> foundProblems;
private InspectionResult(@NotNull LocalInspectionToolWrapper tool, @NotNull List<ProblemDescriptor> foundProblems) {
this.tool = tool;
@@ -718,9 +718,9 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
this.languageIds = languageIds;
}
@NotNull final LocalInspectionToolWrapper tool;
@NotNull final ProblemsHolder holder;
@NotNull final PsiElementVisitor visitor;
@Nullable final Collection<String> languageIds;
@NotNull private final LocalInspectionToolWrapper tool;
@NotNull private final ProblemsHolder holder;
@NotNull private final PsiElementVisitor visitor;
@Nullable private final Collection<String> languageIds;
}
}