use of com.siyeh.ig.fixes.RemoveModifierFix 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