mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
StreamApiMigrationInspection: use collect when computeIfAbsent is used; VariableAccessUtils#variableIsUsed instead of ReferenceSearch (IDEA-CR-16490)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with collect" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Main {
|
||||
private Map<Integer, List<String>> test(String... list) {
|
||||
Map<Integer, List<String>> map = Arrays.stream(list).collect(Collectors.groupingBy(String::length));
|
||||
return map;
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Replace with collect" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
private Map<Integer, List<String>> test(String... list) {
|
||||
Map<Integer, List<String>> map = new HashMap<>();
|
||||
for(String s : l<caret>ist) {
|
||||
map.computeIfAbsent(s.length(), k -> new ArrayList<>()).add(s);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user