mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
StringConcatenationInLoopsInspectionFix: fixed parenthesized append (IDEA-165968), fix renamed to "Convert variable ''{0}'' from String to {1}"
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
void test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
void test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// "Change type of 'res' to StringBuilder" "true"
|
||||
// "Convert variable 'res' from String to StringBuilder" "true"
|
||||
|
||||
public class Main {
|
||||
String test(String[] strings) {
|
||||
@@ -7,7 +7,7 @@ public class Main {
|
||||
if (/*before*/!res/*within*/.isEmpty()) {
|
||||
res += ", ";
|
||||
}
|
||||
res <caret>+= s;
|
||||
res = (res <caret>+ s);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
+1
-1
@@ -2203,4 +2203,4 @@ junit5.converter.fix.name=Migrate to JUnit 5
|
||||
call.to.suspicious.string.method.display.name=Call to suspicious String method
|
||||
call.to.suspicious.string.method.problem.descriptor=<code>String.#ref()</code> called in internationalized context #loc
|
||||
string.concatenation.replace.fix=Replace with StringBuilder
|
||||
string.concatenation.replace.fix.name=Change type of ''{0}'' to {1}
|
||||
string.concatenation.replace.fix.name=Convert variable ''{0}'' from String to {1}
|
||||
|
||||
+1
-1
@@ -423,7 +423,7 @@ public class StringConcatenationInLoopsInspection extends BaseInspection {
|
||||
List<PsiElement> results,
|
||||
PsiAssignmentExpression assignment,
|
||||
CommentTracker ct) {
|
||||
PsiExpression rValue = assignment.getRExpression();
|
||||
PsiExpression rValue = PsiUtil.skipParenthesizedExprDown(assignment.getRExpression());
|
||||
if(assignment.getOperationTokenType().equals(JavaTokenType.EQ)) {
|
||||
if (rValue instanceof PsiPolyadicExpression &&
|
||||
((PsiPolyadicExpression)rValue).getOperationTokenType().equals(JavaTokenType.PLUS)) {
|
||||
|
||||
Reference in New Issue
Block a user