mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-06 01:06:54 +07:00
13 lines
370 B
Java
13 lines
370 B
Java
// "Replace with 'getOrDefault' method call" "false"
|
|
import java.util.Map;
|
|
|
|
public class Main {
|
|
public CharSequence test(Map<String, ? extends CharSequence> map) {
|
|
// cannot replace as map.getOrDefault("xyz", "none") will result in compilation error
|
|
if(map.co<caret>ntainsKey("xyz")) {
|
|
return map.get("xyz");
|
|
} else {
|
|
return "none";
|
|
}
|
|
}
|
|
} |