mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Use CommonQuickFixBundle
GitOrigin-RevId: 742c76ffb768bed2ce9aec4b11f7fc911d7f624c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0737c3410b
commit
4bd6f5a43b
+2
-5
@@ -1,10 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.intellij.lang.regexp.inspection;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -67,7 +64,7 @@ public class EscapedMetaCharacterInspection extends LocalInspectionTool {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Replace with '[" + myC + "]'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", '[' + myC + ']');
|
||||
}
|
||||
|
||||
@Nls
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.intellij.lang.regexp.inspection;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
@@ -58,7 +55,7 @@ public class OctalEscapeInspection extends LocalInspectionTool {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Replace with '" + myHex + '\'';
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", myHex);
|
||||
}
|
||||
|
||||
@Nls
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.intellij.lang.regexp.inspection;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.lang.injection.InjectedLanguageManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
@@ -100,7 +97,7 @@ public class RepeatedSpaceInspection extends LocalInspectionTool {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Replace with ' {" + myCount + "}'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", " {" + myCount + "}");
|
||||
}
|
||||
|
||||
@Nls
|
||||
|
||||
+2
-5
@@ -1,10 +1,7 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.intellij.lang.regexp.inspection;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
@@ -65,7 +62,7 @@ public class SingleCharAlternationInspection extends LocalInspectionTool {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Replace with '" + myText + '\'';
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", myText);
|
||||
}
|
||||
|
||||
@Nls
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.intellij.lang.regexp.validation;
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInspection.CommonQuickFixBundle;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -43,7 +44,9 @@ class SimplifyQuantifierAction implements IntentionAction {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getText() {
|
||||
return myReplacement == null ? "Remove '{1,1}'" : "Replace with '" + myReplacement + "'";
|
||||
return myReplacement == null ?
|
||||
CommonQuickFixBundle.message("fix.remove", "{1,1}") :
|
||||
CommonQuickFixBundle.message("fix.replace.with.x", myReplacement);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class InvalidComparatorMethodReferenceInspection extends AbstractBaseJava
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Replace with " + (reverse ? "Comparator.reverseOrder()" : "Comparator.naturalOrder()");
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", reverse ? "Comparator.reverseOrder()" : "Comparator.naturalOrder()");
|
||||
}
|
||||
|
||||
@Nls
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.codeInspection.dataFlow;
|
||||
|
||||
import com.intellij.codeInspection.CommonQuickFixBundle;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.dataFlow.types.DfType;
|
||||
@@ -99,7 +100,7 @@ public class DfaOptionalSupport {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Replace with '." + myTargetMethodName + "()'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", "." + myTargetMethodName + "()");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.codeInspection.dataFlow.fix;
|
||||
|
||||
import com.intellij.codeInspection.CommonQuickFixBundle;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -37,7 +38,7 @@ public class ReplaceWithConstantValueFix implements LocalQuickFix {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Replace with '" + myPresentableName + "'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", myPresentableName);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-1
@@ -505,7 +505,7 @@ public final class MagicConstantInspection extends AbstractBaseJavaLocalInspecti
|
||||
List<String> names = myMemberValuePointers.stream().map(SmartPsiElementPointer::getElement).filter(Objects::nonNull)
|
||||
.map(PsiElement::getText).collect(Collectors.toList());
|
||||
String expression = StringUtil.join(names, " | ");
|
||||
return "Replace with '" + expression + "'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", expression);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with Comparator.naturalOrder()" "true"
|
||||
// "Replace with 'Comparator.naturalOrder()'" "true"
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with Comparator.reverseOrder()" "true"
|
||||
// "Replace with 'Comparator.reverseOrder()'" "true"
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with Comparator.naturalOrder()" "false"
|
||||
// "Replace with 'Comparator.naturalOrder()'" "false"
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with Comparator.naturalOrder()" "true"
|
||||
// "Replace with 'Comparator.naturalOrder()'" "true"
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with Comparator.reverseOrder()" "true"
|
||||
// "Replace with 'Comparator.reverseOrder()'" "true"
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with Comparator.reverseOrder()" "false"
|
||||
// "Replace with 'Comparator.reverseOrder()'" "false"
|
||||
import java.util.function.IntBinaryOperator;
|
||||
|
||||
public class Main {
|
||||
|
||||
+2
-5
@@ -2,10 +2,7 @@
|
||||
package com.intellij.refactoring.typeMigration.inspections;
|
||||
|
||||
import com.intellij.codeInsight.intention.impl.AddOnDemandStaticImportAction;
|
||||
import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -105,7 +102,7 @@ public class MigrateAssertToMatcherAssertInspection extends AbstractBaseJavaLoca
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Replace with '" + StringUtil.getShortName(myMatchersClassName) + ".assertThat'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", StringUtil.getShortName(myMatchersClassName) + ".assertThat");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.siyeh.ig.internationalization;
|
||||
|
||||
import com.intellij.codeInspection.CommonQuickFixBundle;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.lang.injection.InjectedLanguageManager;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
@@ -69,7 +70,7 @@ public class UnnecessaryUnicodeEscapeInspection extends BaseInspection {
|
||||
else if (c == '\t') {
|
||||
return "Replace with tab character";
|
||||
}
|
||||
return "Replace with '" + c + "'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", c);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.siyeh.ig.numeric;
|
||||
|
||||
import com.intellij.codeInspection.CommonQuickFixBundle;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.dataFlow.CommonDataflow;
|
||||
import com.intellij.codeInspection.dataFlow.types.DfConstantType;
|
||||
@@ -129,7 +130,7 @@ public class DivideByZeroInspection extends BaseInspection {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Replace with 'NaN'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", "NaN");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class UnpredictableBigDecimalConstructorCallInspection extends BaseInspec
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Replace with 'BigDecimal.valueOf()'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", "BigDecimal.valueOf()");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ public class RedundantClassCallInspection extends AbstractBaseJavaLocalInspectio
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Replace with 'instanceof'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", PsiKeyword.INSTANCEOF);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -109,7 +109,7 @@ public class BoundedWildcardInspection extends AbstractBaseJavaLocalInspectionTo
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return "Replace with '? " + (isExtends ? "extends" : "super") + "'";
|
||||
return CommonQuickFixBundle.message("fix.replace.with.x", "? " + (isExtends ? PsiKeyword.EXTENDS : PsiKeyword.SUPER));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user