mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
14 lines
431 B
Java
14 lines
431 B
Java
// "Convert variable 'res' from String to StringBuilder (null-safe)" "true-preview"
|
|
|
|
public class Main {
|
|
String test(String[] strings) {
|
|
StringBuilder res = null;
|
|
res = (res == null ? new StringBuilder("null") : res).append("foo");
|
|
for (String s : strings) {
|
|
res.append(", ");
|
|
res.append(s);
|
|
}
|
|
return res.toString(); // known to be not-null at this point
|
|
}
|
|
}
|