mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 08:51:02 +07:00
Otherwise, we may try to remove variableType of wrong alias Fixes IDEA-264644 toCollection(() -> list) is not recognized as mutation method for list GitOrigin-RevId: ea9b87d3aed5fa187fd13565bd433af5c044d536
25 lines
625 B
Java
25 lines
625 B
Java
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
|
|
class Main2 {
|
|
// IDEA-264644
|
|
void test() {
|
|
List<String> list = new ArrayList<>();
|
|
Stream.of("foo", "bar").collect(Collectors.toCollection(() -> list));
|
|
if (list.isEmpty()) {}
|
|
}
|
|
|
|
// IDEA-221210
|
|
public static void main(String[] args) {
|
|
List<Integer> originalList = new ArrayList<>();
|
|
originalList.add(1);
|
|
final List<Integer> newList = originalList.stream()
|
|
.collect(Collectors.toCollection(() -> new ArrayList<>(1)));
|
|
|
|
boolean empty = newList.isEmpty();
|
|
}
|
|
|
|
}
|