Search in sources :

Example 1 with EncapsulateVariableFix

use of com.siyeh.ig.fixes.EncapsulateVariableFix 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()]);
}
Also used : EncapsulateVariableFix(com.siyeh.ig.fixes.EncapsulateVariableFix) PsiField(com.intellij.psi.PsiField) ArrayList(java.util.ArrayList) InspectionGadgetsFix(com.siyeh.ig.InspectionGadgetsFix) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsiField (com.intellij.psi.PsiField)1 InspectionGadgetsFix (com.siyeh.ig.InspectionGadgetsFix)1 EncapsulateVariableFix (com.siyeh.ig.fixes.EncapsulateVariableFix)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1