Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/stringConcatInLoop/beforeNullSafeToString.java
T
2020-08-03 09:51:39 +00:00

18 lines
361 B
Java

// "Introduce new StringBuilder to update variable 'res' (null-safe)" "true"
public class SB {
public static void main(String[] args) {
String res = null;
for (String arg : args) {
if (res == null) {
res = "[";
} else {
res +<caret>= ",";
}
res += arg;
}
res += "]";
System.out.println(res);
}
}