use of com.siyeh.ig.InspectionGadgetsFix in project intellij-community by JetBrains.
the class PublicFieldInspection method buildFixes.
@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final List<InspectionGadgetsFix> fixes = new ArrayList<>();
final PsiField field = (PsiField) infos[0];
fixes.add(new EncapsulateVariableFix(field.getName()));
AddToIgnoreIfAnnotatedByListQuickFix.build(field, ignorableAnnotations, fixes);
return fixes.toArray(new InspectionGadgetsFix[fixes.size()]);
}
use of com.siyeh.ig.InspectionGadgetsFix in project intellij-community by JetBrains.
the class TooBroadThrowsInspection method buildFixes.
@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final PsiElement context = (PsiElement) infos[2];
final SuppressForTestsScopeFix suppressFix = SuppressForTestsScopeFix.build(this, context);
if (suppressFix == null) {
return new InspectionGadgetsFix[] { buildFix(infos) };
}
return new InspectionGadgetsFix[] { buildFix(infos), suppressFix };
}
use of com.siyeh.ig.InspectionGadgetsFix in project intellij-community by JetBrains.
the class NonBooleanMethodNameMayNotStartWithQuestionInspection method buildFixes.
@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final PsiElement context = (PsiElement) infos[0];
final InspectionGadgetsFix suppressFix = SuppressForTestsScopeFix.build(this, context);
if (suppressFix == null) {
return new InspectionGadgetsFix[] { new RenameFix() };
}
return new InspectionGadgetsFix[] { new RenameFix(), suppressFix };
}
use of com.siyeh.ig.InspectionGadgetsFix in project intellij-community by JetBrains.
the class PublicConstructorInNonPublicClassInspection method buildFixes.
@Override
@NotNull
public InspectionGadgetsFix[] buildFixes(Object... infos) {
final List<InspectionGadgetsFix> fixes = new ArrayList();
final PsiMethod constructor = (PsiMethod) infos[0];
final PsiClass aClass = constructor.getContainingClass();
if (aClass != null && aClass.hasModifierProperty(PsiModifier.PRIVATE)) {
fixes.add(new SetConstructorModifierFix(PsiModifier.PRIVATE));
}
fixes.add(new RemoveModifierFix(PsiModifier.PUBLIC));
return fixes.toArray(new InspectionGadgetsFix[fixes.size()]);
}
Aggregations