use of com.siyeh.ig.fixes.RenameFix in project intellij-community by JetBrains.
the class NonSerializableObjectPassedToObjectStream method foo.
public void foo() throws IOException {
final ObjectOutputStream stream = new ObjectOutputStream(null);
stream.writeObject(new Integer(3));
stream.writeObject(new RenameFix());
}
use of com.siyeh.ig.fixes.RenameFix in project intellij-community by JetBrains.
the class UnusedCatchParameterInspection method buildFixes.
@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final boolean namedIgnoreButUsed = ((Boolean) infos[0]).booleanValue();
final PsiElement context = (PsiElement) infos[1];
final InspectionGadgetsFix fix = SuppressForTestsScopeFix.build(this, context);
if (namedIgnoreButUsed) {
if (fix == null) {
return InspectionGadgetsFix.EMPTY_ARRAY;
}
return new InspectionGadgetsFix[] { fix };
}
final RenameFix renameFix = new RenameFix("ignored", false, false);
if (fix == null) {
return new InspectionGadgetsFix[] { renameFix };
}
return new InspectionGadgetsFix[] { renameFix, fix };
}
use of com.siyeh.ig.fixes.RenameFix in project intellij-community by JetBrains.
the class ClassNameDiffersFromFileNameInspection method buildFix.
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
final PsiJavaFile file = (PsiJavaFile) infos[0];
final String fileName = file.getName();
final int prefixIndex = fileName.indexOf((int) '.');
final String filenameWithoutPrefix = fileName.substring(0, prefixIndex);
final PsiClass[] classes = file.getClasses();
for (PsiClass psiClass : classes) {
final String className = psiClass.getName();
if (filenameWithoutPrefix.equals(className)) {
return null;
}
}
return new RenameFix(filenameWithoutPrefix);
}
use of com.siyeh.ig.fixes.RenameFix 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 };
}
Aggregations