Java8CollectionsApiInspection is split into 4 separate inspections

This commit is contained in:
Tagir Valeev
2016-10-04 13:15:57 +07:00
parent c6cf323132
commit 6629cc0fb1
37 changed files with 745 additions and 451 deletions
@@ -0,0 +1,17 @@
// "Replace with 'computeIfAbsent' method call" "false"
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class Main {
public void testMap(Map<String, List<String>> map, String key, String value) {
int size = 5;
if(map.isEmpty()) size = 10;
List<String> list = map.get(key);
if(list == <caret>null) {
list = new ArrayList<>(size);
map.put(key, list);
}
list.add(value);
}
}