Files
openide/java/java-tests/testData/inspection/java9CollectionFactory/beforeHashMapOfEntriesComments.java
Bas Leijdekkers 54975a31ba Improve inspection problem descriptor
GitOrigin-RevId: 8abf2188d180865951921d5ebfd9bd7bd33bfc6b
2021-03-18 08:40:12 +00:00

29 lines
673 B
Java

// "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<String, String> _map = new HashMap<>();
//_map.put("a", "b");
_map.put("c", "d");
_map.put("e", "f");
_map.put("g", "h");
_map.put("i", "j");
_map.put("k", "l");
// and m
_map.put("m", "n");
_map.put("o", "p");
_map.put("r", "s");
_map.put("t" /*uuuu*/, "u");
_map.put("v", "w");
_map.put("x", /*you*/ "y");
// q was forgotten!
_map.put("q", "z");
map = Collections.unmodifiab<caret>leMap(_map);
}
}