mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
StreamApiMigration: automatically simplify IntStream.range().mapXyz chains; IndexedContainer#getElementType: do not erase
This commit is contained in:
+1
-2
@@ -2,11 +2,10 @@
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class Test {
|
||||
public void test(List<Integer> ints) {
|
||||
long[] arr = IntStream.range(0, ints.size()).mapToLong(ints::get).toArray();
|
||||
long[] arr = ints.stream().mapToLong(anInt -> anInt).toArray();
|
||||
System.out.println(Arrays.toString(arr));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -2,11 +2,10 @@
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class Test {
|
||||
public void test(List<List<String>> list) {
|
||||
List<?>[] arr = IntStream.range(0, list.size()).mapToObj(list::get).toArray(List[]::new);
|
||||
List<?>[] arr = list.stream().toArray(List[]::new);
|
||||
System.out.println(Arrays.toString(arr));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user