mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure getFamilyName returns non-empty string: groovy
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@ public class MultipleRepositoryUrlsFix extends GroovyFix {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return GradleInspectionBundle.message("multiple.repository.urls.fix.name");
|
||||
}
|
||||
}
|
||||
|
||||
+2
-7
@@ -38,18 +38,13 @@ public abstract class GroovyFix implements LocalQuickFix {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
};
|
||||
public static final GroovyFix[] EMPTY_ARRAY = new GroovyFix[0];
|
||||
|
||||
//to appear in "Apply Fix" statement when multiple Quick Fixes exist
|
||||
@Override
|
||||
@NotNull
|
||||
public String getFamilyName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull Project project,
|
||||
|
||||
+8
@@ -26,6 +26,7 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiType;
|
||||
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyFix;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory;
|
||||
@@ -99,4 +100,11 @@ public class GrCastFix extends GroovyFix implements LocalQuickFix {
|
||||
public String getName() {
|
||||
return "Cast to " + myExpectedType.getPresentableText();
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Add cast";
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -22,6 +22,7 @@ import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiType;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyFix;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyInspectionBundle;
|
||||
@@ -73,4 +74,11 @@ public class GrChangeVariableType extends GroovyFix {
|
||||
public String getName() {
|
||||
return GroovyInspectionBundle.message("change.lvalue.type", myName, myType);
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Change variable type";
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -136,6 +136,13 @@ public class GroovyAssignmentCanBeOperatorAssignmentInspection
|
||||
m_name = "Replace '=' with '" + signText + "='";
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Simplify";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
|
||||
+8
@@ -20,6 +20,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiType;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyFix;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
@@ -77,4 +78,11 @@ public class ParameterCastFix extends GroovyFix {
|
||||
public String getName() {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Add cast";
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class GroovyNonShortCircuitBooleanInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Replace with short-circuit expression";
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -99,6 +99,13 @@ public class GroovyRangeTypeCheckInspection extends BaseInspection {
|
||||
public String getName() {
|
||||
return GroovyInspectionBundle.message("fix.class", psiClass.getName());
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Fix range class";
|
||||
}
|
||||
};
|
||||
}
|
||||
return null;
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class GroovyDoubleNegationInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Remove double negation";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ public class GroovyPointlessArithmeticInspection extends BaseInspection {
|
||||
private static class PointlessArithmeticFix extends GroovyFix {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Simplify";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ public class GroovyPointlessBooleanInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return GroovyInspectionBundle.message("pointless.boolean.quickfix");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class GroovyConditionalCanBeConditionalCallInspection extends BaseInspect
|
||||
private static class CollapseConditionalFix extends GroovyFix {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Replace with conditional call";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class GroovyConditionalCanBeElvisInspection extends BaseInspection {
|
||||
return new GroovyFix() {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Convert Conditional to Elvis";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class GroovyConditionalWithIdenticalBranchesInspection extends BaseInspec
|
||||
private static class CollapseConditionalFix extends GroovyFix {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Collapse conditional expression";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ public class GroovyConstantConditionalInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Simplify";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class GroovyConstantIfStatementInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Simplify";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public class GroovyIfStatementWithIdenticalBranchesInspection extends BaseInspec
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Collapse 'if' statement'";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ public class GroovyReturnFromClosureCanBeImplicitInspection extends BaseInspecti
|
||||
private static class MakeReturnImplicitFix extends GroovyFix {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Make return implicit";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ public class GroovyTrivialConditionalInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Simplify";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ public class GroovyTrivialIfInspection extends BaseInspection {
|
||||
private static class TrivialIfFix extends GroovyFix {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Simplify";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ public class GroovyUnnecessaryContinueInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Remove unnecessary continue";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ public class GroovyUnnecessaryReturnInspection extends BaseInspection {
|
||||
private static class UnnecessaryReturnFix extends GroovyFix {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Remove unnecessary return";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class GroovyListGetCanBeKeyedAccessInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Replace with keyed access";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class GroovyListSetCanBeKeyedAccessInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Replace with keyed access";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class GroovyMapGetCanBeKeyedAccessInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Replace with keyed access";
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ public class GroovyMapPutCanBeKeyedAccessInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return "Replace with keyed access";
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -20,6 +20,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiType;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.GroovyBundle;
|
||||
@@ -70,6 +71,13 @@ public class CreateFieldFromConstructorLabelFix extends GroovyFix {
|
||||
return GroovyBundle.message("create.field.from.usage", getFieldName());
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Create field";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) throws IncorrectOperationException {
|
||||
myFix.doFix(project, ArrayUtil.EMPTY_STRING_ARRAY, getFieldName(), calculateTypeConstrains(), myNamedArgument);
|
||||
|
||||
+8
@@ -22,6 +22,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
|
||||
import com.intellij.psi.util.InheritanceUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyFix;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyInspectionBundle;
|
||||
@@ -108,4 +109,11 @@ public class AddClassToExtendsFix extends GroovyFix {
|
||||
public String getName() {
|
||||
return GroovyInspectionBundle.message("implement.class", myInterfaceName);
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Implement";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.intellij.psi.PsiTypeParameter;
|
||||
import com.intellij.psi.util.PsiTypesUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyFix;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyInspectionBundle;
|
||||
@@ -93,6 +94,13 @@ public class AddMethodFix extends GroovyFix {
|
||||
return GroovyInspectionBundle.message("add.method", myMethodName, myClass.getName());
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Add method";
|
||||
}
|
||||
|
||||
static String generateTypeText(GrTypeDefinition aClass) {
|
||||
StringBuilder returnType = new StringBuilder(aClass.getName());
|
||||
final PsiTypeParameter[] typeParameters = aClass.getTypeParameters();
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class ReplaceWithImportFix extends GroovyFix {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
public String getFamilyName() {
|
||||
return GroovyInspectionBundle.message("replace.qualified.name.with.import");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.refactoring.RefactoringActionHandler;
|
||||
import com.intellij.refactoring.RefactoringActionHandlerFactory;
|
||||
import com.intellij.refactoring.RefactoringFactory;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyFix;
|
||||
@@ -50,6 +51,13 @@ public class RenameFix extends GroovyFix implements RefactoringQuickFix {
|
||||
}
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Rename";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFix(@NotNull final Project project, @NotNull ProblemDescriptor descriptor) {
|
||||
final PsiElement element = descriptor.getPsiElement();
|
||||
|
||||
Reference in New Issue
Block a user