mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-24 00:50:53 +07:00
Fixes IDEA-304740 FuseStreamOperationsInspection fix produces red code GitOrigin-RevId: b9a169e54bae1de448194b8debb39f79904ceb90
17 lines
432 B
Java
17 lines
432 B
Java
// "Fuse 'toArray' into the Stream API chain" "false"
|
|
import java.util.*;
|
|
import java.util.stream.*;
|
|
|
|
class Test {
|
|
public Object[] getArray(String[] input, boolean f) {
|
|
List<String> list = Arrays.stream(input)
|
|
.filter(Objects::nonNull)
|
|
.<caret>collect(Collectors.toList());
|
|
String[] data = new String[] {};
|
|
if (f) {
|
|
return list.toArray();
|
|
}
|
|
list.add("hello");
|
|
return list.toArray();
|
|
}
|
|
} |