use of com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection in project intellij-community by JetBrains.
the class RemoveRedundantUncheckedSuppressionTest method configureLocalInspectionTools.
@NotNull
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
final PossibleHeapPollutionVarargsInspection varargsInspection = new PossibleHeapPollutionVarargsInspection();
final UncheckedWarningLocalInspection warningLocalInspection = new UncheckedWarningLocalInspection();
final RedundantSuppressInspection inspection = new RedundantSuppressInspection() {
@NotNull
@Override
protected InspectionToolWrapper[] getInspectionTools(PsiElement psiElement, @NotNull InspectionManager manager) {
return new InspectionToolWrapper[] { new LocalInspectionToolWrapper(varargsInspection), new LocalInspectionToolWrapper(warningLocalInspection) };
}
};
return new LocalInspectionTool[] { new LocalInspectionTool() {
@Nls
@NotNull
@Override
public String getGroupDisplayName() {
return inspection.getGroupDisplayName();
}
@Nls
@NotNull
@Override
public String getDisplayName() {
return inspection.getDisplayName();
}
@NotNull
@Override
public String getShortName() {
return inspection.getShortName();
}
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session) {
return new JavaElementVisitor() {
@Override
public void visitClass(PsiClass aClass) {
checkMember(aClass, inspection, holder);
}
@Override
public void visitMethod(PsiMethod method) {
checkMember(method, inspection, holder);
}
};
}
private void checkMember(PsiMember member, RedundantSuppressInspection inspection, ProblemsHolder holder) {
final ProblemDescriptor[] problemDescriptors = inspection.checkElement(member, InspectionManager.getInstance(getProject()));
if (problemDescriptors != null) {
for (ProblemDescriptor problemDescriptor : problemDescriptors) {
holder.registerProblem(problemDescriptor);
}
}
}
}, varargsInspection, warningLocalInspection };
}
use of com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection in project intellij-community by JetBrains.
the class GraphInferenceHighlightingTest method testPartialRawSubstitutionToAvoidInferringObjectsWhenRawExpected.
public void testPartialRawSubstitutionToAvoidInferringObjectsWhenRawExpected() throws Exception {
final UncheckedWarningLocalInspection localInspection = new UncheckedWarningLocalInspection();
enableInspectionTool(localInspection);
doTest(true);
}
use of com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection in project intellij-community by JetBrains.
the class LightAdvHighlightingJdk6Test method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
enableInspectionTools(new UnusedDeclarationInspection(), new UncheckedWarningLocalInspection(), new JavacQuirksInspection(), new RedundantCastInspection());
setLanguageLevel(LanguageLevel.JDK_1_6);
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_6, getModule(), getTestRootDisposable());
}
use of com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection in project intellij-community by JetBrains.
the class LightAdvHighlightingJdk7Test method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
enableInspectionTools(new UnusedDeclarationInspection(), new UncheckedWarningLocalInspection(), new JavacQuirksInspection(), new RedundantCastInspection());
setLanguageLevel(LanguageLevel.JDK_1_7);
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_7, getModule(), getTestRootDisposable());
}
use of com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection in project intellij-community by JetBrains.
the class LightAdvHighlightingJdk9Test method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
enableInspectionTools(new UnusedDeclarationInspection(), new UncheckedWarningLocalInspection(), new RedundantCastInspection(), new JavaDocReferenceInspection());
setLanguageLevel(LanguageLevel.JDK_1_9);
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_9, getModule(), getTestRootDisposable());
}
Aggregations