mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-06-14 18:38:47 +07:00
StreamApiMigrationInspection: enable flatMap with primitive type change
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// "Replace with count()" "true"
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.IntStream;
|
||||
import java.util.stream.LongStream;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Test {
|
||||
public void test() {
|
||||
long count = IntStream.range(0, 10).mapToObj(i -> LongStream.range(0, i)).flatMapToLong(Function.identity()).mapToObj(l -> Stream.of("x", "y", "z")).flatMap(Function.identity()).flatMapToInt(s -> IntStream.range(0, s.length())).count();
|
||||
System.out.println(count);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with count()" "true"
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Test {
|
||||
public void test() {
|
||||
long count = 0;
|
||||
for(int <caret>i=0; i<10; i++) {
|
||||
for(long l = 0; l < i; l++) {
|
||||
for(String s : Arrays.asList("x", "y", "z")) {
|
||||
for(int k = 0; k < s.length(); k++) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println(count);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user