mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-08 21:06:52 +07:00
24 lines
595 B
Java
24 lines
595 B
Java
// "Replace with 'merge' method call" "false"
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
public class Test {
|
|
static Map<String,String> m = new HashMap<>();
|
|
|
|
public static void main(String[] args) {
|
|
addAttribute("some", null);
|
|
System.out.println(m);
|
|
}
|
|
|
|
public static void addAttribute(String attributeName, @Nullable String value) {
|
|
final String current = m.get(attributeName);
|
|
if (current <caret>== null) {
|
|
m.put(attributeName, value);
|
|
}
|
|
else {
|
|
m.put(attributeName, current + "," + value);
|
|
}
|
|
}
|
|
} |