mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
Less smart simplifications after loop-to-stream (keep stream)
This commit is contained in:
+1
-1
@@ -4,6 +4,6 @@ import java.util.*;
|
||||
|
||||
public class Main {
|
||||
private void test(List<String> strs) {
|
||||
String[] arr = strs.toArray();
|
||||
String[] arr = strs.stream().toArray();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import java.util.List;
|
||||
|
||||
public class Test {
|
||||
public void test(List<List<String>> list) {
|
||||
List<?>[] arr = list.toArray(new List[0]);
|
||||
List<?>[] arr = list.stream().toArray(List[]::new);
|
||||
System.out.println(Arrays.toString(arr));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user