IDEA-207434: add generic args when necessary (IDEA-CR-53399)

GitOrigin-RevId: a273d8198f8a19921a4075ed93c81fd84a8bee63
This commit is contained in:
Tagir Valeev
2019-10-14 10:32:59 +00:00
committed by intellij-monorepo-bot
parent 7a424b239f
commit a5474b0313
3 changed files with 45 additions and 2 deletions
@@ -0,0 +1,14 @@
// "Replace with 'Entry.comparingByKey()'" "true"
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
class X {
private static List<Map.Entry<String, Integer>> sortFrequencies(Map<String, Integer> freq) {
return freq.entrySet().stream()
.sorted(Map.Entry.<String, Integer>comparingByKey().thenComparing(Map.Entry::getValue))
.collect(Collectors.toList());
}
}
@@ -0,0 +1,14 @@
// "Replace with 'Entry.comparingByKey()'" "true"
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
class X {
private static List<Map.Entry<String, Integer>> sortFrequencies(Map<String, Integer> freq) {
return freq.entrySet().stream()
.sorted(Comparator.<Map.Entry<String, Integer>, String><caret>comparing(Map.Entry::getKey).thenComparing(Map.Entry::getValue))
.collect(Collectors.toList());
}
}