ChangeToAppendUtil: do not add useless .append("")

Partially fixes IDEA-180178 String concatenation as argument to 'StringBuilder.append()' call should be smarter
This commit is contained in:
Tagir Valeev
2017-10-09 12:12:34 +07:00
parent cdd80f8de4
commit 319d4c205a
3 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
// "Convert variable 'res' from String to StringBuilder" "true"
public class Main {
String test(int[] ints) {
StringBuilder res = new StringBuilder();
for (int i : ints) {
res.append(i);
}
return res.toString();
}
}

View File

@@ -0,0 +1,11 @@
// "Convert variable 'res' from String to StringBuilder" "true"
public class Main {
String test(int[] ints) {
String res = "";
for (int i : ints) {
res = res <caret>+ i + "";
}
return res;
}
}