diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/afterPrintlnEmpty.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/afterPrintlnEmpty.java index 6c6e2da4c1b3..df7b2e6bd123 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/afterPrintlnEmpty.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/afterPrintlnEmpty.java @@ -1,4 +1,4 @@ -// "Delete element" "true" +// "Remove argument" "true" class Foo { public static void main(String[] args) { System.out.println(); diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/afterStringBuilderEmpty.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/afterStringBuilderEmpty.java index b8551e094e7b..74ce71a6bb61 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/afterStringBuilderEmpty.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/afterStringBuilderEmpty.java @@ -1,4 +1,4 @@ -// "Delete element" "true" +// "Remove argument" "true" class Foo { public static void main(String[] args) { StringBuilder s = new StringBuilder(); diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/beforePrintlnEmpty.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/beforePrintlnEmpty.java index ae88a266360c..44fcc4259cc7 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/beforePrintlnEmpty.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/beforePrintlnEmpty.java @@ -1,4 +1,4 @@ -// "Delete element" "true" +// "Remove argument" "true" class Foo { public static void main(String[] args) { System.out.println(""); diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/beforeStringBuilderEmpty.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/beforeStringBuilderEmpty.java index f29ad3b2ff90..ba44660b506d 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/beforeStringBuilderEmpty.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantStringOperation/beforeStringBuilderEmpty.java @@ -1,4 +1,4 @@ -// "Delete element" "true" +// "Remove argument" "true" class Foo { public static void main(String[] args) { StringBuilder s = new StringBuilder(("")); diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties index 7882c8623378..c4247499a5c2 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties @@ -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 #ref 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 #ref on compile-time constant is unnecessary #loc inspection.type.may.be.weakened.display.name=Type may be weakened diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/redundancy/RedundantStringOperationInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/redundancy/RedundantStringOperationInspection.java index 4af2920e8bbd..a5b0d2f87509 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/redundancy/RedundantStringOperationInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/redundancy/RedundantStringOperationInspection.java @@ -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); } }