removed unused FileCheckingInspection

This commit is contained in:
Alexey Kudravtsev
2017-03-15 13:36:22 +03:00
parent 7ac81ee11f
commit 242cfc263d
6 changed files with 3 additions and 101 deletions
@@ -15,16 +15,14 @@
*/
package com.intellij.codeInspection.java15api;
import com.intellij.ToolExtensionPoints;
import com.intellij.codeHighlighting.HighlightDisplayLevel;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInsight.daemon.GroupNames;
import com.intellij.codeInsight.intention.QuickFixFactory;
import com.intellij.codeInspection.*;
import com.intellij.codeInspection.BaseJavaBatchLocalInspectionTool;
import com.intellij.codeInspection.InspectionsBundle;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.ExtensionPoint;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.EffectiveLanguageLevelUtil;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
@@ -63,8 +61,6 @@ import java.util.Set;
*/
public class Java15APIUsageInspectionBase extends BaseJavaBatchLocalInspectionTool {
public static final String SHORT_NAME = "Since15";
public static final ExtensionPointName<FileCheckingInspection> EP_NAME =
ExtensionPointName.create(ToolExtensionPoints.JAVA15_INSPECTION_TOOL);
private static final String EFFECTIVE_LL = "effectiveLL";
@@ -184,7 +180,6 @@ public class Java15APIUsageInspectionBase extends BaseJavaBatchLocalInspectionTo
private class MyVisitor extends JavaElementVisitor {
private final ProblemsHolder myHolder;
private final boolean myOnTheFly;
private final ExtensionPoint<FileCheckingInspection> point = Extensions.getRootArea().getExtensionPoint(EP_NAME);
public MyVisitor(final ProblemsHolder holder, boolean onTheFly) {
myHolder = holder;
@@ -345,18 +340,6 @@ public class Java15APIUsageInspectionBase extends BaseJavaBatchLocalInspectionTo
myHolder.registerProblem(reference, InspectionsBundle.message("inspection.1.5.problem.descriptor", getShortName(api)));
}
}
@Override
public void visitFile(PsiFile file) {
for (FileCheckingInspection inspection : point.getExtensions()) {
ProblemDescriptor[] descriptors = inspection.checkFile(file, InspectionManager.getInstance(file.getProject()), myOnTheFly);
if (descriptors != null) {
for (ProblemDescriptor descriptor : descriptors) {
myHolder.registerProblem(descriptor);
}
}
}
}
}
private static String getJdkName(LanguageLevel languageLevel) {
@@ -18,11 +18,6 @@ package com.intellij;
import org.jetbrains.annotations.NonNls;
public interface ToolExtensionPoints {
@NonNls String INVALID_PROPERTY_KEY_INSPECTION_TOOL = "com.intellij.invalidPropertyKeyInspectionTool";
@NonNls String I18N_INSPECTION_TOOL = "com.intellij.i18nInspectionTool";
@NonNls String JAVA15_INSPECTION_TOOL = "com.intellij.java15InspectionTool";
@NonNls String INSPECTIONS_GRAPH_ANNOTATOR = "com.intellij.refGraphAnnotator";
@NonNls String DEAD_CODE_TOOL = "com.intellij.deadCode";
@@ -1,29 +0,0 @@
/*
* Copyright 2000-2013 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.
*/
package com.intellij.codeInspection;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author yole
*/
public interface FileCheckingInspection {
@Nullable
ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly);
}
@@ -14,12 +14,8 @@
* limitations under the License.
*/
/**
* @author cdr
*/
package com.intellij.codeInspection.i18n;
import com.intellij.ToolExtensionPoints;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.GroupNames;
@@ -29,8 +25,6 @@ import com.intellij.codeInspection.ex.BaseLocalInspectionTool;
import com.intellij.ide.util.TreeClassChooser;
import com.intellij.ide.util.TreeClassChooserFactory;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.extensions.ExtensionPoint;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.ui.DialogWrapper;
@@ -405,21 +399,6 @@ public class I18nInspection extends BaseLocalInspectionTool {
return "nls";
}
@Override
@Nullable
public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) {
ExtensionPoint<FileCheckingInspection> point = Extensions.getRootArea().getExtensionPoint(ToolExtensionPoints.I18N_INSPECTION_TOOL);
final FileCheckingInspection[] fileCheckingInspections = point.getExtensions();
for(FileCheckingInspection obj: fileCheckingInspections) {
ProblemDescriptor[] descriptors = obj.checkFile(file, manager, isOnTheFly);
if (descriptors != null) {
return descriptors;
}
}
return null;
}
private ProblemDescriptor[] checkElement(@NotNull PsiElement element, @NotNull InspectionManager manager, boolean isOnTheFly) {
StringI18nVisitor visitor = new StringI18nVisitor(manager, isOnTheFly);
element.accept(visitor);
@@ -15,7 +15,6 @@
*/
package com.intellij.codeInspection.i18n;
import com.intellij.ToolExtensionPoints;
import com.intellij.codeHighlighting.HighlightDisplayLevel;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInsight.CodeInsightBundle;
@@ -24,8 +23,6 @@ import com.intellij.codeInspection.*;
import com.intellij.lang.properties.PropertiesReferenceManager;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.lang.properties.references.I18nUtil;
import com.intellij.openapi.extensions.ExtensionPoint;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
@@ -125,22 +122,6 @@ public class InvalidPropertyKeyInspection extends BaseJavaLocalInspectionTool {
return problems.isEmpty() ? null : problems.toArray(new ProblemDescriptor[problems.size()]);
}
@Override
@Nullable
public ProblemDescriptor[] checkFile(@NotNull final PsiFile file, @NotNull final InspectionManager manager, boolean isOnTheFly) {
ExtensionPoint<FileCheckingInspection> point = Extensions.getRootArea().getExtensionPoint(
ToolExtensionPoints.INVALID_PROPERTY_KEY_INSPECTION_TOOL);
final FileCheckingInspection[] fileCheckingInspections = point.getExtensions();
for (FileCheckingInspection obj : fileCheckingInspections) {
ProblemDescriptor[] descriptors = obj.checkFile(file, manager, isOnTheFly);
if (descriptors != null) {
return descriptors;
}
}
return null;
}
private static class UnresolvedPropertyVisitor extends JavaRecursiveElementWalkingVisitor {
private final InspectionManager myManager;
private final List<ProblemDescriptor> myProblems = new ArrayList<>();
-7
View File
@@ -102,13 +102,6 @@
<extensionPoint name="junitRecognizer"
interface="com.intellij.execution.JUnitRecognizer"/>
<extensionPoint name="i18nInspectionTool"
interface="com.intellij.codeInspection.FileCheckingInspection"/>
<extensionPoint name="invalidPropertyKeyInspectionTool"
interface="com.intellij.codeInspection.FileCheckingInspection"/>
<extensionPoint name="java15InspectionTool"
interface="com.intellij.codeInspection.FileCheckingInspection"/>
<extensionPoint name="deadCode"
interface="com.intellij.codeInspection.reference.EntryPoint"/>
<extensionPoint name="predefinedMigrationMapProvider"