mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
Fix IDEA-177647 Convert String to StringBuilder intention produces wrong code
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// "Convert variable 'str1' from String to StringBuilder" "true"
|
||||
|
||||
public class IntentionBug {
|
||||
public static void main(String[] args) {
|
||||
/*1*/
|
||||
/*2*/
|
||||
StringBuilder str1 = new StringBuilder();
|
||||
for (char i = 'a'; i < 'd'; i++) {
|
||||
str1.append(i).append((char) (i + 1));
|
||||
str1.append(i).append((char) (i + 1));
|
||||
str1.append(1).append(2).append(3);
|
||||
str1.append(1 + 2 + 3);
|
||||
}
|
||||
System.out.println(str1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Convert variable 'str1' from String to StringBuilder" "true"
|
||||
|
||||
public class IntentionBug {
|
||||
public static void main(String[] args) {
|
||||
String str1 = "";
|
||||
for (char i = 'a'; i < 'd'; i++) {
|
||||
str1 = str1 <caret>+ i + (char) (i + 1);
|
||||
str1 = /*1*/str1/*2*/+ i + (char) (i + 1);
|
||||
str1 = str1+1+2+3;
|
||||
str1 = str1+(1+2+3);
|
||||
}
|
||||
System.out.println(str1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user