mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-18 05:36:16 +07:00
2e7492686e
Fixes IDEA-183139 "String to StringBuilder" quick fix may cause NPE
16 lines
379 B
Java
16 lines
379 B
Java
// "Convert variable 'res' from String to StringBuilder" "true"
|
|
|
|
public class Main {
|
|
String test(String[] strings) {
|
|
StringBuilder res = null;
|
|
for (String s : strings) {
|
|
if(res == null) {
|
|
res = new StringBuilder(s);
|
|
} else {
|
|
res.append(s);
|
|
}
|
|
}
|
|
return res.toString();
|
|
}
|
|
}
|