IDEA-184825 "Redundant String operation" inspection - rename 'Delete element' to 'Delete argument'

This commit is contained in:
Tagir Valeev
2018-01-12 11:44:40 +07:00
parent 3a3e1ee369
commit 30b3d4a558
6 changed files with 8 additions and 5 deletions
@@ -1,4 +1,4 @@
// "Delete element" "true"
// "Remove argument" "true"
class Foo {
public static void main(String[] args) {
System.out.println();
@@ -1,4 +1,4 @@
// "Delete element" "true"
// "Remove argument" "true"
class Foo {
public static void main(String[] args) {
StringBuilder s = new StringBuilder();
@@ -1,4 +1,4 @@
// "Delete element" "true"
// "Remove argument" "true"
class Foo {
public static void main(String[] args) {
System.out.println("<caret>");
@@ -1,4 +1,4 @@
// "Delete element" "true"
// "Remove argument" "true"
class Foo {
public static void main(String[] args) {
StringBuilder s = new StringBuilder(("<caret>"));
@@ -2216,6 +2216,7 @@ inspection.redundant.string.remove.fix.name=Remove redundant ''{0}()'' call
inspection.redundant.string.fix.family.name=Remove redundant call
inspection.redundant.string.call.message=Call to <code>#ref</code> is redundant #loc
inspection.redundant.string.argument.message=Unnecessary empty string argument
inspection.redundant.string.remove.argument.fix.name=Remove argument
inspection.redundant.string.intern.on.constant.message=Call to <code>#ref</code> on compile-time constant is unnecessary #loc
inspection.type.may.be.weakened.display.name=Type may be weakened
@@ -77,8 +77,10 @@ public class RedundantStringOperationInspection extends AbstractBaseJavaLocalIns
private void checkUnnecessaryEmptyStringArgument(PsiCall call) {
PsiExpression argument = getSingleEmptyStringArgument(call);
if (argument != null) {
LocalQuickFix fix =
new DeleteElementFix(argument, InspectionGadgetsBundle.message("inspection.redundant.string.remove.argument.fix.name"));
holder.registerProblem(argument, InspectionGadgetsBundle.message("inspection.redundant.string.argument.message"),
ProblemHighlightType.LIKE_UNUSED_SYMBOL, new DeleteElementFix(argument));
ProblemHighlightType.LIKE_UNUSED_SYMBOL, fix);
}
}