IDEA-179280 java9 - intention to use Map.ofEntries

This commit is contained in:
Tagir Valeev
2017-09-21 13:24:48 +07:00
parent 0b99eeb259
commit f533da27ef
6 changed files with 98 additions and 19 deletions
@@ -0,0 +1,17 @@
// "Replace with 'Map.ofEntries' call" "true"
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class Test {
static final Map<String, String> map;
static {
//_map.put("a", "b");
map = Map.ofEntries(Map.entry("c", "d"), Map.entry("e", "f"), Map.entry("g", "h"), Map.entry("i", "j"), Map.entry("k", "l"),
// and m
Map.entry("m", "n"), Map.entry("o", "p"), Map.entry("r", "s"), Map.entry("t", /*uuuu*/"u"), Map.entry("v", "w"), Map.entry("x", /*you*/ "y"),
// q was forgotten!
Map.entry("q", "z"));
}
}