mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-161198 Migration from Stream API back to for loops
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class Main {
|
||||
private static Integer[][] test(int[] numbers) {
|
||||
List<Integer[]> list = new ArrayList<>();
|
||||
for (int number : numbers) {
|
||||
Integer n = number;
|
||||
Integer[] integers = new Integer[]{n};
|
||||
list.add(integers);
|
||||
}
|
||||
return list.toArray(new Integer[0][]);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Arrays.asList(test(new int[] {1,2,3})));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user