Search in sources :

Example 1 with IntroduceConstantFix

use of com.siyeh.ig.fixes.IntroduceConstantFix in project intellij-community by JetBrains.

the class MagicNumberInspection method buildFixes.

@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
    final PsiElement context = (PsiElement) infos[0];
    final InspectionGadgetsFix fix = SuppressForTestsScopeFix.build(this, context);
    if (fix == null) {
        return new InspectionGadgetsFix[] { new IntroduceConstantFix() };
    }
    return new InspectionGadgetsFix[] { new IntroduceConstantFix(), fix };
}
Also used : InspectionGadgetsFix(com.siyeh.ig.InspectionGadgetsFix) PsiElement(com.intellij.psi.PsiElement) IntroduceConstantFix(com.siyeh.ig.fixes.IntroduceConstantFix) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 InspectionGadgetsFix (com.siyeh.ig.InspectionGadgetsFix)1 IntroduceConstantFix (com.siyeh.ig.fixes.IntroduceConstantFix)1 NotNull (org.jetbrains.annotations.NotNull)1