mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
IDEA-173272 "Double brace initialization" may suggest 'Map.of' in JDK9
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace with 'Map.of' call" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test {
|
||||
private static final Map<Integer, String> myMap2 = Map.of(1, "one", 2, "two");
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with 'Map.of' call" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test {
|
||||
private static final Map<Integer, String> myMap2 = Collections.unmodifiab<caret>leMap(new HashMap<>() {
|
||||
{
|
||||
put(1, "one");
|
||||
put(2, "two");
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user