mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
IDEA-194142 IDEA should recognize min/max usage with reversed order
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// "Fix all 'Comparator can be simplified' problems in file" "true"
|
||||
import java.util.*;
|
||||
import java.util.stream.*;
|
||||
|
||||
class Test {
|
||||
void test(List<String> list) {
|
||||
Collections.min(list, Comparator.naturalOrder());
|
||||
list.stream().max(String.CASE_INSENSITIVE_ORDER);
|
||||
list.stream().min(String.CASE_INSENSITIVE_ORDER);
|
||||
Collector<String, ?, Optional<String>> c = Collectors.minBy(Comparator.comparing(String::length));
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Fix all 'Comparator can be simplified' problems in file" "true"
|
||||
import java.util.*;
|
||||
import java.util.stream.*;
|
||||
|
||||
class Test {
|
||||
void test(List<String> list) {
|
||||
Collections.m<caret>ax(list, Comparator.reverseOrder());
|
||||
list.stream().min(String.CASE_INSENSITIVE_ORDER.reversed());
|
||||
list.stream().max(Collections.reverseOrder(String.CASE_INSENSITIVE_ORDER));
|
||||
Collector<String, ?, Optional<String>> c = Collectors.maxBy(Comparator.comparing(String::length, Comparator.reverseOrder()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user