mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
LambdaUtil#isSafeLambdaReplacement; used in ComparatorCombinators
Fixes IDEA-183048 stream replacing issue
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with Comparator.comparing" "false"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
public <K extends Comparable, V extends Comparable> void sortByValues(Map<K, V> inMap,
|
||||
HashMap<Character, Float> outMap) {
|
||||
|
||||
inMap.entrySet()
|
||||
.stream()
|
||||
.sorted((it1, it2<caret>) -> it1.getValue().compareTo(it2.getValue()))
|
||||
.forEachOrdered(it -> outMap.put((Character) it.getKey(), (Float) it.getValue()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user