mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
IG: quickfix name and family name can be the same
This commit is contained in:
+4
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Bas Leijdekkers
|
||||
* Copyright 2008-2017 Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,6 @@ import com.intellij.psi.PsiModifier;
|
||||
import com.intellij.psi.PsiModifierList;
|
||||
import com.intellij.psi.PsiModifierListOwner;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.VisibilityUtil;
|
||||
import com.siyeh.InspectionGadgetsBundle;
|
||||
import com.siyeh.ig.InspectionGadgetsFix;
|
||||
@@ -30,7 +29,6 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ChangeModifierFix extends InspectionGadgetsFix {
|
||||
public static final String FAMILY_NAME = "Change modifier";
|
||||
|
||||
@PsiModifier.ModifierConstant private final String modifierText;
|
||||
|
||||
@@ -47,15 +45,13 @@ public class ChangeModifierFix extends InspectionGadgetsFix {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return FAMILY_NAME;
|
||||
return "Change modifier";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFix(Project project, ProblemDescriptor descriptor)
|
||||
throws IncorrectOperationException {
|
||||
public void doFix(Project project, ProblemDescriptor descriptor) {
|
||||
final PsiElement element = descriptor.getPsiElement();
|
||||
final PsiModifierListOwner modifierListOwner =
|
||||
PsiTreeUtil.getParentOfType(element, PsiModifierListOwner.class);
|
||||
final PsiModifierListOwner modifierListOwner = PsiTreeUtil.getParentOfType(element, PsiModifierListOwner.class);
|
||||
if (modifierListOwner == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2015 Dave Griffith, Bas Leijdekkers
|
||||
* Copyright 2003-2017 Dave Griffith, Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -25,7 +25,6 @@ import com.intellij.refactoring.makeStatic.MakeMethodStaticProcessor;
|
||||
import com.intellij.refactoring.makeStatic.Settings;
|
||||
import com.siyeh.InspectionGadgetsBundle;
|
||||
import com.siyeh.ig.InspectionGadgetsFix;
|
||||
import com.siyeh.ig.fixes.ChangeModifierFix;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -47,16 +46,10 @@ public class MethodMayBeStaticInspection extends MethodMayBeStaticInspectionBase
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return InspectionGadgetsBundle.message("change.modifier.quickfix", PsiModifier.STATIC);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return ChangeModifierFix.FAMILY_NAME;
|
||||
return InspectionGadgetsBundle.message("change.modifier.quickfix", PsiModifier.STATIC);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user